Skip to content

Fix race conditions in TaskContext and CancellationContext cancellation#1689

Open
diachenko-mischa wants to merge 1 commit intomasterfrom
mdiachenko/HERESDK-12253-PreExecutionCancel
Open

Fix race conditions in TaskContext and CancellationContext cancellation#1689
diachenko-mischa wants to merge 1 commit intomasterfrom
mdiachenko/HERESDK-12253-PreExecutionCancel

Conversation

@diachenko-mischa
Copy link
Copy Markdown
Contributor

  • Enable pre-execution cancellation in TaskContext by registering a cancellation token in constructor that invokes PreExecuteCancel()
  • Clear cancellation token in ~TaskContextImpl to prevent dangling refs
  • Fix CancellationContext::CancelOperation() to swap out the token before calling Cancel(), avoiding re-entrancy issues
  • Update BlockingCancel test to cover pre-execution cancellation

Relates-To: HERESDK-12253

@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/HERESDK-12253-PreExecutionCancel branch 2 times, most recently from 22094a0 to 105bbc8 Compare April 1, 2026 17:30
- Enable pre-execution cancellation in TaskContext by registering a
  cancellation token in constructor that invokes PreExecuteCancel()
- Clear cancellation token in ~TaskContextImpl to prevent dangling refs
- Fix CancellationContext::CancelOperation() to swap out the token
  before calling Cancel(), avoiding re-entrancy issues
- Update BlockingCancel test to cover pre-execution cancellation

Relates-To: HERESDK-12253
Signed-off-by: Mykhailo Diachenko <ext-mykhailo.z.diachenko@here.com>
@diachenko-mischa diachenko-mischa force-pushed the mdiachenko/HERESDK-12253-PreExecutionCancel branch from 105bbc8 to d1cb9e7 Compare April 1, 2026 17: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