Skip to content

Conversation

@ohadzeliger
Copy link
Contributor

Add MDC context to the throttled iterator:

  • Add a constructor that takes in MDC
  • Pass the MDC to the executor
  • Test that the context is available at the ItemHandler

Resolves #3739

@ohadzeliger ohadzeliger self-assigned this Nov 11, 2025
@ohadzeliger ohadzeliger added the enhancement New feature or request label Nov 11, 2025
@ohadzeliger ohadzeliger marked this pull request as ready for review November 11, 2025 19:52
* @return the newly minted iterator
*/
public ThrottledRetryingIterator<T> build() {
this.transactionalRunner = new TransactionalRunner(database, contextConfigBuilder);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the constructor that takes a TransactionalRunner is called, the one provided will not be used here.
That call does not appear to be used, maybe worth just deleting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, deleted (should have been deleted earlier).

this.contextConfigBuilder = contextConfigBuilder;
this.cursorCreator = cursorCreator;
this.singleItemHandler = singleItemHandler;
// set defaults
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest below that you remove the other constructor, but if not, perhaps worth settings these ones in the field declaration, and remove the duplication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the other constructor should have been deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throttled iterator does not have access to MDC context

2 participants