Skip to content

Conversation

sooperset
Copy link
Owner

Description

This PR fixes a circular reference between ConfluenceClient and ConfluencePreprocessor that was preventing proper garbage collection and causing memory leaks in long-running processes.

The preprocessor was storing a reference to the client, which in turn held a reference to the preprocessor, creating a circular dependency that Python's garbage collector couldn't break.

Relevant issue: #532

Changes

  • Removed confluence_client parameter from BasePreprocessor.__init__
  • Updated process_html_content and related methods to accept client as parameter
  • Modified all calling code in mixins to pass client when needed
  • Aligned implementation with JiraPreprocessor pattern

Testing

  • Unit tests added/updated
  • Integration tests passed
  • Manual checks performed: Verified preprocessor functionality still works correctly with client passed as parameter

Checklist

  • Code follows project style guidelines (linting passes).
  • Tests added/updated for changes.
  • All tests pass locally.
  • Documentation updated (if needed).

Remove circular reference between ConfluenceClient and ConfluencePreprocessor
that was preventing proper garbage collection and causing memory leaks.

The preprocessor no longer stores a reference to the client. Instead, the
client is passed as a parameter to methods that need it for user lookups.
This follows the same pattern used by JiraPreprocessor.
@sooperset sooperset merged commit 7714850 into main Jun 27, 2025
4 of 5 checks passed
@sooperset sooperset deleted the fix/circular-reference-confluence-preprocessor branch June 27, 2025 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant