Use factored-out BuildResult serializer#1318
Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom Dec 8, 2023
Merged
Conversation
For the record, here is the Nix 2.19 version: https://github.com/NixOS/nix/blob/2.19-maintenance/src/libstore/serve-protocol.cc, which is what we would initially use. It is a more complete version of what Hydra has today except for one thing: it always unconditionally sets the start/stop times. I think that is correct at the other end seems to unconditionally measure them, but just to be extra careful, I reproduced the old behavior of falling back on Hydra's own measurements if `startTime` is 0. The only difference is that the fallback `stopTime` is now measured from after the entire `BuildResult` is transferred over the wire, but I think that should be negligible if it is measurable at all. (And remember, this is fallback case I already suspect is dead code.)
Ericson2314
commented
Dec 7, 2023
| ) | ||
| { | ||
|
|
||
| BuildResult result; |
Member
Author
There was a problem hiding this comment.
Just moving this down, it is for the response so it doesn't need to be in scope for the request.
Ericson2314
commented
Dec 7, 2023
| result.isNonDeterministic = readInt(conn.from); | ||
| auto start = readInt(conn.from); | ||
| auto stop = readInt(conn.from); | ||
| if (start && start) { |
Member
Author
There was a problem hiding this comment.
I think this was supposed to be start && stop :)
Member
Author
There was a problem hiding this comment.
NixOS/nix@b070606 This is the corresponding Nix commit
Ericson2314
commented
Dec 7, 2023
| ServeProto::Serialise<DrvOutputs>::read(localStore, conn); | ||
| stopTime = time(0); | ||
|
|
||
| if (!result.startTime) { |
Member
Author
There was a problem hiding this comment.
Since it was start && start before, i.e. start, now the converse condition is !start.
13 tasks
tomberek
approved these changes
Dec 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For the record, here is the Nix 2.19 version:
https://github.com/NixOS/nix/blob/2.19-maintenance/src/libstore/serve-protocol.cc, which is what we would initially use.
It is a more complete version of what Hydra has today except for one thing: it always unconditionally sets the start/stop times.
I think that is correct at the other end seems to unconditionally measure them, but just to be extra careful, I reproduced the old behavior of falling back on Hydra's own measurements if
startTimeis 0.The only difference is that the fallback
stopTimeis now measured from after the entireBuildResultis transferred over the wire, but I think that should be negligible if it is measurable at all. (And remember, this is fallback case I already suspect is dead code.)