sdk: remove webhook wait entries after async callback completion - #15
Open
chayu163 wants to merge 1 commit into
Open
sdk: remove webhook wait entries after async callback completion#15chayu163 wants to merge 1 commit into
chayu163 wants to merge 1 commit into
Conversation
Webhook-based async APIs are placed in the static waittingApis map before the request is sent. The sync path removes the entry after waiting, but the async callback path called completion.complete(res) without removing the finished job, causing long-running clients to retain stale Api references indefinitely. Remove jobUuid from waittingApis once the async completion handler has been invoked. Sync webhook cleanup behavior is unchanged. Fixes ZSvirt#11
Contributor
|
Thanks for the contribution. We haven’t observed this issue in our current usage, but we agree that the async webhook path may retain completed entries. To help us evaluate the change, could you add a regression test demonstrating the cleanup behavior? It may also be safer to perform the removal in a finally block so cleanup still occurs if the completion handler throws. We’ll review the change further once the test is available. |
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.
Webhook-based async APIs are placed in the static waittingApis map before the request is sent. The sync path removes the entry after waiting, but the async callback path called completion.complete(res) without removing the finished job, causing long-running clients to retain stale Api references indefinitely.
Remove jobUuid from waittingApis once the async completion handler has been invoked. Sync webhook cleanup behavior is unchanged.
Fixes #11