Repository navigation
fix: complete futures whose tasks a SerialExecutor drops - #409
Merged
Merged
Conversation
A rejected task was dropped silently, so a future it would have completed stayed open forever: any operation after the runtime closed, and any event an application's own executor refused. Tasks can now carry a fallback that runs when they are dropped; the event tasks that complete futures use it, and a rejection by an executor that is not shut down goes to the error handler. Once the runtime has stopped its control threads, it fails every future of the API still open. This replaces the shutdown hook PeerImpl.open used, and removes the unused shutdown().
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.
A task the
SerialExecutorcould not schedule was dropped silently, so a future it would have completed stayed open forever: any operation on a peer after its runtime closed, and any result an application's own event executor rejected.toPublic,whenConnected,whenClosed,whenOpen) use it, so those futures complete anyway.PeerClosedException, including those of calls made after the close.PeerImpl.openuses the fallback instead of the shutdown hook from fix: close races in MediaReader.getInfo and WebRtc.createPeer #406, and the unusedSerialExecutor.shutdown()is removed.