-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Use factored-out BuildResult
serializer
#1318
Use factored-out BuildResult
serializer
#1318
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.)
@@ -286,9 +286,6 @@ static BuildResult performBuild( | |||
counter & nrStepsBuilding | |||
) | |||
{ | |||
|
|||
BuildResult result; |
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.
Just moving this down, it is for the response so it doesn't need to be in scope for the request.
result.isNonDeterministic = readInt(conn.from); | ||
auto start = readInt(conn.from); | ||
auto stop = readInt(conn.from); | ||
if (start && start) { |
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 think this was supposed to be start && stop
:)
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.
FWIW this was added in 9989e6c
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.
NixOS/nix@b070606 This is the corresponding Nix commit
ServeProto::Serialise<DrvOutputs>::read(localStore, conn); | ||
stopTime = time(0); | ||
|
||
if (!result.startTime) { |
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.
Since it was start && start
before, i.e. start
, now the converse condition is !start
.
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 entireBuildResult
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.)