Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stopper: Add method for task-tracking #4

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

bobvawter
Copy link
Contributor

@bobvawter bobvawter commented Aug 28, 2024

This change adds a Call() method to stopper.Context. This allows the stopper to track tasks that were not started using the Go() method.

Additionally, a Len() method is added to return the number of tasks being tracked within a stopper hierarchy.


This change is Reviewable

bobvawter added a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

This commit depends on cockroachdb/field-eng-powertools#4
This change adds a Call() method to stopper.Context. This allows the stopper to
track tasks that were not started using the Go() method.

Additionally, a Len() method is added to return the number of tasks being
tracked within a stopper hierarchy.
Copy link

@sravotto sravotto left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @BramGruneir and @MattWhelan)

Copy link
Member

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MattWhelan)

@bobvawter bobvawter merged commit c680a70 into main Aug 29, 2024
5 checks passed
@bobvawter bobvawter deleted the bob_stopper_call branch August 29, 2024 14:22
bobvawter added a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

This commit depends on cockroachdb/field-eng-powertools#4
bobvawter added a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

Replicator will now exit if a stuck task is detected by the lease loop since
there is no other way to guarantee that the task would not continue at some
arbitrary point in the future.

This commit depends on cockroachdb/field-eng-powertools#4
github-merge-queue bot pushed a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

Replicator will now exit if a stuck task is detected by the lease loop since
there is no other way to guarantee that the task would not continue at some
arbitrary point in the future.

This commit depends on cockroachdb/field-eng-powertools#4
bobvawter added a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

Replicator will now exit if a stuck task is detected by the lease loop since
there is no other way to guarantee that the task would not continue at some
arbitrary point in the future.

This commit depends on cockroachdb/field-eng-powertools#4

(cherry picked from commit 644ad7c)
bobvawter added a commit to cockroachdb/replicator that referenced this pull request Aug 29, 2024
This change corrects a context-break, where callbacks executed by the key
scheduler were executed using a context from the scheduler's workgroup. In
cases where the lease loop recycles and the target database is executing
slowly, the old queries were not guaranteed to have been canceled when
the next iteration of the loop starts.

Replicator will now exit if a stuck task is detected by the lease loop since
there is no other way to guarantee that the task would not continue at some
arbitrary point in the future.

This commit depends on cockroachdb/field-eng-powertools#4

(cherry picked from commit 644ad7c)
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.

3 participants