Repository navigation
Conversation
|
Mainly to address the issue at: #357 Adds a cancellation timeout which will close the connection once elapsed. Request timeouts will also call |
|
@gsterjov I just fixed an issue with stack traces being incorrect for tests written in Coffee Script (see #567). Would you mind merging in the latest |
|
|
||
| cancelTimeout() { | ||
| this.cancelTimer = undefined; | ||
| return this.close(); |
There was a problem hiding this comment.
I don't think the return here is necessary.
Also, on top of that, I'm not sure whether just calling this.close is the best course of action here. The in-flight request that did not get cancelled in time will get a RequestError, but it will not be clear that this error was passed because cancellation timed out.
There was a problem hiding this comment.
Good point. I'll try get it to return an appropriate error message
| this.requestTimer = undefined; | ||
| this.messageIo.sendMessage(TYPE.ATTENTION); | ||
| return this.transitionTo(this.STATE.SENT_ATTENTION); | ||
| this.cancel(); |
There was a problem hiding this comment.
This will set canceled=true which in turn will cause the error message to be Canceled instead of Timeout. You should have three different error messages for the three different cases - user initiated cancel(), request timer timeout and cancel timer timeout (i.e. timeout waiting for Attention acknowledgement)
There was a problem hiding this comment.
There are actually two flavors of cancel timer timeout error messages:
- Attention sent in response to request timeout.
- Attention sent in response to user initiated cancel()
There was a problem hiding this comment.
Great, thanks for the help! I'm thinking its possible to still have the single cancel timer but to stick some bool flags to determine what kind of cancellation it is.
| this.socketError = this.socketError.bind(this); | ||
| this.requestTimeout = this.requestTimeout.bind(this); | ||
| this.connectTimeout = this.connectTimeout.bind(this); | ||
| this.cancelTimeout = this.cancelTimeout.bind(this); |
There was a problem hiding this comment.
A test would be nice though I can't think of a way to add it...
There was a problem hiding this comment.
I'll see what I can do. Might be a bit contrived but at the very least it would be good to test the various types of cancellation
|
As far as I can tell, this patch fixes a serious bug that my team was experiencing in production with the Is there anything I can do to help get this PR merged? |
|
@ihgrant Thanks for the ping. I'll take a look and will try to get this merged asap! ❤️ |
|
The cancellation rework in #846 also implements a proper request cancellation timer. 👍 |
|
Nice! |
|
🎉 This issue has been resolved in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.