[FIX] The process was freezing in some cases when HTTP calls exceeds timeout on integrations#11253
Merged
sampaiodiego merged 4 commits intodevelopfrom Jun 26, 2018
Merged
[FIX] The process was freezing in some cases when HTTP calls exceeds timeout on integrations#11253sampaiodiego merged 4 commits intodevelopfrom
sampaiodiego merged 4 commits intodevelopfrom
Conversation
Member
|
previously, if the HTTP call exceeds the vm time out, the integration execution would failure and a message would not be sent. with this change, the integration runs successfully after the timeout.. is this an intentional change? |
Member
Author
|
@sampaiodiego yes, cuz the async time does not count in the script execution time. |
sampaiodiego
requested changes
Jun 26, 2018
|
|
||
| const result = vm.runInNewContext('script.process_incoming_request({ request: request })', sandbox, { | ||
| const result = Future.fromPromise(vm.runInNewContext(` | ||
| new Promise((resolve, reject) => { |
Member
There was a problem hiding this comment.
please, add a catch to this Promise, otherwise calling reject will thrown a unhandled promise rejection
edit: I've added 👍
sampaiodiego
previously approved these changes
Jun 26, 2018
Member
sampaiodiego
left a comment
There was a problem hiding this comment.
I'm approving this, but since it is changing the behavior of how integration scripts failure, I would use a tag [BREAK] instead of [FIX]
Member
Author
|
LGTM |
sampaiodiego
approved these changes
Jun 26, 2018
Merged
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
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.
Closes #10062
The problem happens when we have a timeout exception triggered by some async method like the HTTP, this async method is turned sync by the usage of Fibers, for some reason that exception, some times we need more than one, stops the oplog tail method that uses Fibers too leading to a stop of reactivity we use to sync the clients.
The solution was start a new Fiber inside the VM to prevent the exceptions to stop the fibers, in my tests this change solved the problem.