rebuild-index: fix race condition#39594
Conversation
|
Could you take this PR over @scottwittenburg? Looks like you're using a thread pool where you can't due to race conditions during package loading. Also notice that parallel fetch that requires a Stage is process safe (fs lock) but not thread safe (fs lock bookkeeping). On top of that |
|
Yeah, I'll dig into this, but I'm a little unclear on a couple things. How do you know there is a race condition during package loading? Is this message in the job you linked somehow indicative of that? And a side question: is that actually resulting in a broken binary index?
I'm trying to understand this, but I'm not sure I get it yet. Is package loading triggered by creating the db? Can that just be done outside the threadpool?
Is that comment somehow specific to this PR? I don't recall that fetching
Yeah, google seems to confirm that's true, I wasn't aware of that. |
|
In this case it's probably Maybe the specific issue can be fixed by creating the package cache ahead of time, but I would recommend getting rid of ThreadPool, since Spack is almost nowhere thread safe (and neither is Python's standard library...).
Maybe? I think it's taking old Spec formats and writing them in a new format, but it can't set new virtual attributes on edges. |
|
Use of ThreadPool was also pointed out in review btw: #32796 (review) |
alalazo
left a comment
There was a problem hiding this comment.
Getting this in. If we have performance drops we can act on them in following PRs
See for example https://gitlab.spack.io/spack/spack/-/jobs/8029468
It looks like a race condition is hit somewhere down the line when constructing
spec objects, so just make it sequential again. Notice that awscli will still fetch
in parallel anyways.