nix icon indicating copy to clipboard operation
nix copied to clipboard

Factor our connection code for worker proto like serve proto

Open Ericson2314 opened this issue 1 year ago • 2 comments

Motivation

This increases test coverage, and gets the worker protocol ready to be used by Hydra.

Why don't we just try to use the store interface in Hydra? Well, the problem is that the store interface works on connection pools, with each operation getting potentially a different connection, but the way temp roots work requires that we keep one logical "transaction" (temp root session) using the same connection.

The longer-term solution probably is making connections themselves implement the store interface, but that is something that builds on this, so I feel OK that this is not churn in the wrong direction.

Context

Fixes #9584

Progress on https://github.com/NixOS/hydra/issues/688

Priorities and Process

Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Ericson2314 avatar May 27 '24 04:05 Ericson2314

Why don't we just try to use the store interface in Hydra? Well, the problem is that the store interface works on connection pools, with each operation getting potentially a different connection, but the way temp roots work requires that we keep one logical "transaction" (temp root session) using the same connection.

Not sure I follow. IIRC https://github.com/NixOS/hydra/pull/1200 performs the copying and building in one process (hydra-build-step) which should have only one connection to the remote store.

I guess there is an architectural issue with temp roots, remote stores and connection pooling, but that's not really Hydra-specific.

Regardless, :+1: on factoring out the protocol code.

edolstra avatar May 30 '24 15:05 edolstra

@edolstra Yeah I mean short of your PR, with the current architecture. It is true with your PR this sort of stuff is not needed, but per

Regardless, 👍 on factoring out the protocol code.

I think it is a fine thing to do anyways, or at least neutral enough that we shouldn't worry about doing it and then it becoming unnecessary.

Ericson2314 avatar May 30 '24 15:05 Ericson2314

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-06-03-nix-team-meeting-minutes-149/46582/1

nixos-discourse avatar Jun 06 '24 08:06 nixos-discourse