fix(model): avoid adding timeout on Model.init()
buffering to avoid unintentional dangling open handles
#15251
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.
Fix #15241
Summary
Make
Model.init()
skip buffering timeouts introduced in #15229Based on discussion from #15241, I think this is a reasonable approach which gives us the benefits of #15229 without the implicit dangling handles. The following Jest test won't complain about open handles:
However, the following script will still error out with buffering timeout, as opposed to silently exiting with no error.
So explicit connection helper calls will be subject to buffer timeouts, but we will ignore buffer timeouts for
Model.init()
becauseModel.init()
is called implicitly and there are use cases where you may want to create a model without opening the underlying connection, like testing document functionality.Examples