Repository navigation
Ensure that Config's set of ports is generated atomically. - #11299
Conversation
gsnedders
left a comment
There was a problem hiding this comment.
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__?
|
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. |
|
@jgraham That would mean moving a fair bit of code out of the Config class to deal with merging JSON blobs, no? |
|
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? |
|
The tests passed locally with my |
jgraham
left a comment
There was a problem hiding this comment.
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.
…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.
My theory is that when there are several browsers pointed at the same server we can end up with two threads that enter the
portsmethod simultaneously, create an emptyold_portsdictionary, 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.