Skip to content

Comments

Use factored-out BuildResult serializer#1318

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:use-build-result-serialiser
Dec 8, 2023
Merged

Use factored-out BuildResult serializer#1318
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:use-build-result-serialiser

Conversation

@Ericson2314
Copy link
Member

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.)

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.)
)
{

BuildResult result;
Copy link
Member Author

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) {
Copy link
Member Author

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 :)

Copy link
Member Author

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

Copy link
Member Author

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) {
Copy link
Member Author

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.

@Ericson2314 Ericson2314 merged commit 8310218 into NixOS:master Dec 8, 2023
@Ericson2314 Ericson2314 deleted the use-build-result-serialiser branch December 8, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants