Skip to content

Conversation

@WhitWaldo
Copy link
Contributor

@WhitWaldo WhitWaldo commented Feb 26, 2025

Description

The original implementation of the jobs mapping handler allowed the user to provide a CancellationToken to the mapping. This unfortunately meant that long-running jobs mappers would fail when this timeout was hit because it was globally applied instead of applied to each request invocation, as intended.

I've modified the approach to instead allow the user to pass an optional TimeSpan indicating a timeout value to use. As part of the mapping, a new CancellationToken is created using this timeout value, if provided (defaults to CancellationToken.None if not) so it's now performed on a per-request basis.

I've also updated the example and unit tests to go along with this.

Thanks to @siri-varma for their research in identifying this issue.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1472

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

…ter instead of a cancellation token. This applies the timeout, if specified, to each invocation instead of as a global timeout.

Signed-off-by: Whit Waldo <[email protected]>
@WhitWaldo WhitWaldo added kind/bug Something isn't working area/client/jobs labels Feb 26, 2025
@WhitWaldo WhitWaldo added this to the v1.15 milestone Feb 26, 2025
@WhitWaldo WhitWaldo self-assigned this Feb 26, 2025
@WhitWaldo WhitWaldo marked this pull request as ready for review February 26, 2025 09:35
@WhitWaldo WhitWaldo requested review from a team as code owners February 26, 2025 09:35
@WhitWaldo WhitWaldo merged commit c94b61e into dapr:master Feb 26, 2025
12 checks passed
@WhitWaldo WhitWaldo deleted the jobs-fix branch February 26, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client/jobs kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recurring job invocation failing with unexpected status code

1 participant