-
Notifications
You must be signed in to change notification settings - Fork 542
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
fix: memory store #3834
base: main
Are you sure you want to change the base?
fix: memory store #3834
Conversation
The test for locking is failing |
Simplify and fix memory leak
I dont' see why we need any locking here... I might need some help fixing the tests though |
977c314
to
2c1c839
Compare
530ec18
to
df0d75b
Compare
await readResponse(result) | ||
|
||
notEqual(store.createWriteStream(request, requestValue), undefined) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this test was removed? Is this functionality not needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO. We don't need locking. The behavior is removed.
b570a78
to
57e0416
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
cc @flakey5 |
db4512e
to
551e79d
Compare
f426a4c
to
70308fc
Compare
With how we have the cache store currently set up, locking is needed so we don't read from a response that's currently being written to For example if a request is made to some server, it's possible for another request to be made to the same resource before the first request finishes. If that happens currently (with locking), the cache store will see that the first request is still in flight since it's locked and return undefined. Without locking, the cache store will see that the first request has some cached details (from the Or in other words what could happen w/o locking,
Another smaller thing is that w/o locking we could end up w/ two write streams for the same resource. Currently, because we return Optionally, we could just not write the response into I think we should stick with the locking, however, either or works |
I still think we should skip locking. Unless you have a strong opinion about it. |
Simplify and fix memory leak
This relates to...
Rationale
Changes
Features
Bug Fixes
Breaking Changes and Deprecations
Status