-
Notifications
You must be signed in to change notification settings - Fork 9
forceDerivation(): Wait for async path write after forcing value #176
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -705,11 +705,11 @@ StorePath AttrCursor::forceDerivation() | |
| auto aDrvPath = getAttr(root->state.sDrvPath); | ||
| auto drvPath = root->state.store->parseStorePath(aDrvPath->getString()); | ||
| drvPath.requireDerivation(); | ||
| root->state.waitForPath(drvPath); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens right now, with the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understood it as the critical bit was needing to make sure there's a wait after calling
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original In the common case where the attribute is cached and the corresponding .drv file exists in the store, there is no need to wait for anything. And if the .drv file has been GC'ed, we need to evaluate the attribute to recreate it and then wait.
Right, this bug triggers if the eval cache gets out of sync with what's in the store. |
||
| if (!root->state.store->isValidPath(drvPath) && !settings.readOnlyMode) { | ||
| /* The eval cache contains 'drvPath', but the actual path has | ||
| been garbage-collected. So force it to be regenerated. */ | ||
| aDrvPath->forceValue(); | ||
| root->state.waitForPath(drvPath); | ||
| if (!root->state.store->isValidPath(drvPath)) | ||
| throw Error( | ||
| "don't know how to recreate store derivation '%s'!", root->state.store->printStorePath(drvPath)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really qualified to review this, but I'm curious - why did you move this line and not duplicate it?
Is there no chance that
requireDerivationmight also require waiting, and would otherwise avoid having toforceValueif you had waited?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comment.