-
Notifications
You must be signed in to change notification settings - Fork 340
fix: Publish request finish on close or finish, but only once for a r… #2625
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
Merged
Conversation
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
…equest. Use weakset to ensure idempotency.
Qard
reviewed
Dec 19, 2022
Codecov Report
@@ Coverage Diff @@
## master #2625 +/- ##
==========================================
- Coverage 89.00% 88.88% -0.13%
==========================================
Files 298 288 -10
Lines 10381 10135 -246
Branches 33 33
==========================================
- Hits 9240 9008 -232
+ Misses 1141 1127 -14 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Qard
approved these changes
Dec 19, 2022
rochdev
reviewed
Dec 19, 2022
uurien
approved these changes
Dec 22, 2022
Qard
pushed a commit
that referenced
this pull request
Dec 22, 2022
#2625) * fix: Publish request finish on close or finish, but only once for a request. Use weakset to ensure idempotency. * feat: Store response, not request, in finishedSet * feat: lint
Qard
pushed a commit
that referenced
this pull request
Dec 22, 2022
#2625) * fix: Publish request finish on close or finish, but only once for a request. Use weakset to ensure idempotency. * feat: Store response, not request, in finishedSet * feat: lint
Qard
pushed a commit
that referenced
this pull request
Dec 23, 2022
#2625) * fix: Publish request finish on close or finish, but only once for a request. Use weakset to ensure idempotency. * feat: Store response, not request, in finishedSet * feat: lint
This was referenced Dec 24, 2022
Open
juan-fernandez
pushed a commit
that referenced
this pull request
Jan 3, 2023
#2625) * fix: Publish request finish on close or finish, but only once for a request. Use weakset to ensure idempotency. * feat: Store response, not request, in finishedSet * feat: lint
juan-fernandez
pushed a commit
that referenced
this pull request
Jan 4, 2023
#2625) * fix: Publish request finish on close or finish, but only once for a request. Use weakset to ensure idempotency. * feat: Store response, not request, in finishedSet * feat: lint
11 tasks
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.
…equest. Use weakset to ensure idempotency.
What does this PR do?
Closes DataDog/serverless-plugin-datadog#324
Motivation
Popular serverless-specific libraries which implement
express
don't emitclose
events, however they do emitfinish
.This behavior was changed here, and we do not want to revert this as
close
also represents the end of a request, and there are cases where it's correct to emitclose
but notfinish
(eg: client disconnects midway through receiving a response).This change introduces a weakset to track whether we've received
close
orfinish
for a given request, and only emit on the first occurrence.Plugin Checklist
Additional Notes