Skip to content

Minor code docs in EventDrivenFaultTolerantQueryScheduler #19893

Merged
losipiuk merged 1 commit intotrinodb:masterfrom
findepi:findepi/add-or-update-code-comments-in-eventdrivenfaulttolerantqueryscheduler-9113d1
Nov 27, 2023
Merged

Minor code docs in EventDrivenFaultTolerantQueryScheduler #19893
losipiuk merged 1 commit intotrinodb:masterfrom
findepi:findepi/add-or-update-code-comments-in-eventdrivenfaulttolerantqueryscheduler-9113d1

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Nov 24, 2023

No description provided.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Nov 24, 2023
@cla-bot cla-bot bot added the cla-signed label Nov 24, 2023
Optional<Throwable> failure = Optional.empty();
try {
// schedule() is the main logic, but expensive, so we do not want to call it after every event.
// Process events for some time (measured by schedulingDelayer) before invoking schedule() next time.
Copy link
Copy Markdown
Member

@losipiuk losipiuk Nov 24, 2023

Choose a reason for hiding this comment

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

Actually we are processing all the events from queue (up to EVENT_BUFFER_CAPACITY) - and then calling schedule.
scheduleDelayer is only to pause calling schedule in case we observed failures which we believe may impact newly scheduled tasks too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, processEvents() processes all existing events. Not even limited by EVENT_BUFFER_CAPACITY (but it does that in EVENT_BUFFER_CAPACITY portions, repeatedly)
but then, provided that getRemainingDelayInMillis() > 0, we call `processEvents()' waiting for new events (for 1m)

@losipiuk losipiuk merged commit 1378fbe into trinodb:master Nov 27, 2023
@github-actions github-actions bot added this to the 434 milestone Nov 27, 2023
@findepi findepi deleted the findepi/add-or-update-code-comments-in-eventdrivenfaulttolerantqueryscheduler-9113d1 branch November 28, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

2 participants