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

Fix synchronization issue in QueueHandler #118

Merged
merged 2 commits into from Apr 5, 2018

Conversation

2 participants
@jseibert
Copy link
Contributor

jseibert commented Apr 2, 2018

In the event that the current promise triggers another Channel operation serviced by this QueueHandler, channelRead() becomes re-entrant, and crashes with an assertion failure because the last callback in the queue is called twice, and then removed twice.

Instead, tidy up and remove the last handler before satisfying the promise.

Fix synchronization issue in QueueHandler
In the event that the current promise triggers another Channel operation serviced by this QueueHandler, channelRead() becomes re-entrant, and crashes with an assertion failure because the last callback in the queue is called twice, and then removed twice.

Instead, tidy up and remove the last handler before satisfying the promise.

@tanner0101 tanner0101 self-assigned this Apr 4, 2018

@tanner0101 tanner0101 added the bug label Apr 4, 2018

@tanner0101 tanner0101 added this to the 3.0.2 milestone Apr 4, 2018

@tanner0101

This comment has been minimized.

Copy link
Member

tanner0101 commented Apr 4, 2018

@jseibert will merge this for 3.0.2, but is there any way you could provide a snippet to recreate the error? I would like to include that in a unit test somewhere so that we can make sure there are no regressions.

@tanner0101
Copy link
Member

tanner0101 left a comment

Thanks!

@tanner0101 tanner0101 merged commit 4cc852b into vapor:master Apr 5, 2018

8 checks passed

ci/circleci: linux Your tests passed on CircleCI!
Details
ci/circleci: linux-fluent-mysql Your tests passed on CircleCI!
Details
ci/circleci: linux-fluent-postgresql Your tests passed on CircleCI!
Details
ci/circleci: linux-fluent-sqlite Your tests passed on CircleCI!
Details
ci/circleci: linux-jwt Your tests passed on CircleCI!
Details
ci/circleci: linux-leaf Your tests passed on CircleCI!
Details
ci/circleci: linux-redis Your tests passed on CircleCI!
Details
ci/circleci: linux-vapor Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment