-
Notifications
You must be signed in to change notification settings - Fork 82
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
expose lockWaitTimeout to lock options #56
Conversation
@silas I don't want to pressure, but I'm not sure how often this git repo is maintained. I'll need to know if there is an estimation on when this can be merged or I'll need to fork this module. |
I'm not ready to make this change as-is, if you need it right away I'd fork it.
I'm open to increasing the http timeout, I just need to think through the ramifications. What are you setting it to in your environment to make it work? |
THanks for replying! You're setting the http request to lockWaitTime +1 second. AFAIK this setting is to the entire http client request - from the moment a connection to the server has been attempted until a respond has arrived. Again, it's not a matter if the right value, and I don't think increasing it to 5 inside the module is right. |
*Also note that because the http timeout value may be too sensitive to some network environments - this is causing false lock 'end' emittions. |
for a second, I thought to say it is a shame you don't understand the problem and closing the PR, but then I saw you've just committed similar changed to master and tagged version 0.29.0. SO THANK YOU for quickly taking care of this!! This is my first contribution (attempt :)) to someone's else code in github - so just a short question - will this new version will be published to npm repository automatically? |
Thanks for the PR, I decided to use a relative time instead of an absolute time and I'm going to hold off on documenting it for now. I want to rewrite the lock documentation and probably rename it to I've published it to npm and thanks again. |
The default request timeout for a lock kv.get request which is being set is too sensitive for some environments - lockwaittime +1000ms.
This is causing random timeout errors which are emitting 'end' event for the lock.
This change is exposing the lock kv.get kv.get request timeout to the lock constructor options.
If not specified, the default for the request timeout will stay lockwaittime +1000ms.
Also updated README.md to include the 2 lock timeout options.
I hope this can be merged quickly, as currently I'm unable to use the lock as is, and I really wouldn't want to create a new module for my needs.