Repository navigation
Conversation
A lease heartbeat renewal can fail after DurableRuntime's tick()/process() has already returned, e.g. because the backend hiccuped or the lease was taken over. The old code called thread.interrupt() unconditionally, so a late heartbeat failure interrupted whatever the worker thread was running next instead of the finished invocation. Introduce a settled flag: once the invocation's finally block has run, the heartbeat's stop() only flips the stopped flag and never interrupts. While the invocation is still in flight, cancellation behavior is unchanged. Split out of agentscope-ai#4102 for independent review per maintainer feedback.
doFinally releases the task id only after the terminal signal has been delivered downstream, so a subscriber that resumes the task from its completion or error callback (e.g. after an input-required turn) hit "Agent already exists for taskId". Register the release through doOnTerminate/doOnCancel instead, so the id is freed before the terminal event reaches the executor's client. Split out of agentscope-ai#4102 for independent review per maintainer feedback.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doFinallyreleases the task id only after the terminal signal has been delivered downstream, so a subscriber that resumes the task from its completion or error callback (e.g. after an input-required turn) hitAgent already exists for taskId.doOnTerminate/doOnCancelinstead, so the id is freed before the terminal event reaches the executor's client.Test plan
mvn -pl agentscope-extensions/.../agentscope-extensions-a2a-server -am testpasses (231 tests, 0 failures)