-
Notifications
You must be signed in to change notification settings - Fork 150
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
Dangerous shared objects on cache miss #103
Conversation
Hi, thanks for this. I'm not sure I understand the need to clone though. |
We had this situation : |
Seems like the client should do the clone operation since the cost of doing the clone in the cache manager might not be worth it for most people's situations. |
Can be configurable in some way in order to maintain performance but my expected behavior is that I should not worry of other processes. |
I didn't think you could modify an object across processes. Are these clients running in the same process? In any case, it's possible to have multiple clients in the same process requesting the same data at the same time, so I'm ok with doing this if you make it configurable. |
lib/callback_filler.js
Outdated
@@ -1,3 +1,13 @@ | |||
const deepmerge = require('deepmerge'); |
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.
Can you use var
, etc. here instead of ES6 syntax?
package.json
Outdated
@@ -21,6 +21,7 @@ | |||
"license": "MIT", | |||
"dependencies": { | |||
"async": "1.5.2", | |||
"deepmerge": "^1.5.0", |
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.
Please pin this version to exactly 1.5.0
. I know it's a debatable choice :)
…ay#103 * added configurable option safeClone * converted code to ES5 * fixed package.json TODO: - missing documentation about args.safeClone & options.safeClone (grep -n FILLME lib/*)
We were bitten badly by this bug today. eg.
should return before this change it returned Please merge and release! :) |
I'm looking into this now. |
I didn't merge this before because it has a bug and no tests. I'm fixing the bug and adding tests now. |
This is fixed in version 2.10.2 The issue was in the memory store only, so that's where I added the fix, which is to clone the object before setting it in the memory cache. See 84901cc |
No description provided.