Skip to content
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 inprocess oneshot #100

Merged
merged 3 commits into from Aug 31, 2016
Merged

Fix inprocess oneshot #100

merged 3 commits into from Aug 31, 2016

Conversation

@emilio
Copy link
Member

emilio commented Aug 31, 2016

Rebase of #90.

@antrik sent a mail to the list saying he was not going to be active, so I took care of rebasing this.

Holding a global lock on the `ONE_SHOT_SERVERS` map while doing the
blocking `accept()` invocation is a very bad idea -- aside from possible
long-range concurrency problems or deadlocks, it actually creates a race
condition between `accept()` and `connect()`, which the existing test
case triggers pretty much every time on my system.

The solution used here is not the most elegant IMHO -- but it's the only
one I can think of that preserves the current abstraction, with
`accept()` and `connect()` methods on `ServerRecord`.

Possible more elegant (but also way more invasive) solutions would be
moving the `conn_receiver` (along with the `accept()` implementation) to
`OsIpcOneShotServer`; or even keeping *only* `conn_receiver` in
`OsIpcOneShotServer`, while the actual data channel is only created and
sent over the connect channel in the connect/accept phase -- thus
bringing it more in line with the socket implementation...
@emilio
Copy link
Member Author

emilio commented Aug 31, 2016

@bors-servo: r=pcwalton

  • Carry-over from #90, I just fixed the conflicts in the tests.
@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

📌 Commit 2d11d29 has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

Testing commit 2d11d29 with merge cddb6a8...

bors-servo added a commit that referenced this pull request Aug 31, 2016
Fix inprocess oneshot

Rebase of #90.

@antrik sent a mail to the list saying he was not going to be active, so I took care of rebasing this.
@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

💔 Test failed - status-travis

antrik added 2 commits Aug 1, 2016
With the deadlock in the `inprocess` implementation fixed, this should
work fine on Windows now.
…ect()`

Invoking `accept()` after `connect()` used to fail, because the server
record was being dropped while doing the `connect()`. Now dropping it
after the `accept()` instead -- which is safe for either invocation
order, because `accept()` is blocking, and thus never finishes before
`connect()` is done.

Also adding a separate `server_connect_first` test case to explicitly
test this situation. (And modifying the original test case to ensure it
always tests the other situation.)
@emilio emilio force-pushed the emilio:fix-inprocess-oneshot branch from 2d11d29 to db1f5a5 Aug 31, 2016
@emilio
Copy link
Member Author

emilio commented Aug 31, 2016

@bors-servo: r=emilio,pcwalton

  • Uncommented an include that had been commented out in previous PRs.
@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

📌 Commit db1f5a5 has been approved by emilio,pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

Testing commit db1f5a5 with merge 65d8404...

bors-servo added a commit that referenced this pull request Aug 31, 2016
Fix inprocess oneshot

Rebase of #90.

@antrik sent a mail to the list saying he was not going to be active, so I took care of rebasing this.
@bors-servo
Copy link
Contributor

bors-servo commented Aug 31, 2016

☀️ Test successful - status-appveyor, status-travis

@bors-servo bors-servo merged commit db1f5a5 into servo:master Aug 31, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@emilio emilio deleted the emilio:fix-inprocess-oneshot branch Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.