Skip to content

Ensure that Config's set of ports is generated atomically. - #11299

Merged
gsnedders merged 1 commit into
web-platform-tests:masterfrom
jdm:portslock
Jun 6, 2018
Merged

gsnedders merged 1 commit into
web-platform-tests:masterfrom
jdm:portslock

Conversation

@jdm

@jdm jdm commented Jun 1, 2018 •

Copy link
Copy Markdown
Contributor

My theory is that when there are several browsers pointed at the same server we can end up with two threads that enter the ports method simultaneously, create an empty old_ports dictionary, and generate unique ports for any "auto" entries. One of these threads will finish last and overwrite the other thread's results, leading to an inconsistent set of ports between threads.

@wpt-pr-bot
wpt-pr-bot requested review from gsnedders and jgraham June 1, 2018 13:05

@gsnedders gsnedders left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing CI because locks can't be pickled (yay multiprocessing!). Probably we should drop the lock in __getstate__ and readd it in __setstate__?

@jgraham

jgraham commented Jun 4, 2018

Copy link
Copy Markdown
Contributor

Or we could just make the lifecycle of the config object simpler so that we can generate ports in the constructor and there's no race condition.

@gsnedders

Copy link
Copy Markdown
Member

@jgraham That would mean moving a fair bit of code out of the Config class to deal with merging JSON blobs, no?

@jdm

jdm commented Jun 5, 2018

Copy link
Copy Markdown
Contributor Author

Given that this is an attempt to alleviate a really common intermittent problem when running tests in Servo, and I really don't know this code well at all, could we limit the requests to changes that would be straightforward for me to make?

@jdm

jdm commented Jun 5, 2018 •

Copy link
Copy Markdown
Contributor Author

The tests passed locally with my __getstate__/__setstate__ changes.

@jgraham jgraham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to fix the problem now. I still think we should fix things to prevent the config being changed arbitarily after it's created; we don't have a use case that requires that. But I didn't mean to suggest that had to be part of this PR.

@gsnedders
gsnedders merged commit 7018426 into web-platform-tests:master Jun 6, 2018
gsnedders added a commit to gsnedders/web-platform-tests that referenced this pull request Jun 7, 2018
…eb-platform-tests#11299)"

This reverts commit 7018426.

Fixes web-platform-tests#11397; per @jdm "my PR didn't help at all" hence reverting
doesn't reintroduce any flakiness.
jgraham pushed a commit that referenced this pull request Jun 7, 2018
…11299)" (#11418)

This reverts commit 7018426.

Fixes #11397; per @jdm "my PR didn't help at all" hence reverting
doesn't reintroduce any flakiness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants