Skip to content

namespace services by server, not by client - #6914

Closed
vito wants to merge 1 commit into
dagger:mainfrom
vito:fix-svc-namespacing
Closed

vito wants to merge 1 commit into
dagger:mainfrom
vito:fix-svc-namespacing

Conversation

@vito

@vito vito commented Mar 21, 2024 •

Copy link
Copy Markdown
Contributor

Previously it was possible to start a dependent service in one module API call, and then use it again in a later call, only to have it fail because it cannot resolve the service address, even though it's still running. This happened because each invocation has its own client ID, and client IDs were used to build service addresses. (Repro)

This change brings service addresses into alignment with the recent change to uniq them by service ID instead of client ID. The overall effect is that services are deduped within a Dagger invocation, even across module calls. So with this change, the service will just stay running and be re-used by a later call, thanks to the grace period.

@vito

vito commented Mar 21, 2024

Copy link
Copy Markdown
Contributor Author

The right tests are failing - I was wondering whether they depended on this behavior. Will check back on this later and see what needs to change.

@sipsma

sipsma commented Mar 21, 2024 •

Copy link
Copy Markdown
Contributor

I took a look at the failures because this felt like it might overlap with what I'm working on right now to finish isolating sessions to each client.

Not 100% sure but the failures might be due to the fact currently nested execs get their own servers (whereas function execs are special cased to reuse the same server). That seems like it could explain the errors.

If so, fortunately part of the changes I'm working on results in those nested execs sharing the same server (among a lot of other simplifications). I'll see if I can cherry-pick your commit here and test it out.

@vito

vito commented Mar 21, 2024

Copy link
Copy Markdown
Contributor Author

@sipsma Haha yeah that sounds like exactly it, what a nice coincidence!

@sipsma

sipsma commented Mar 21, 2024

Copy link
Copy Markdown
Contributor

@vito yeah those tests pass with my changes included. Unfortunately my changes won't be safe to merge until I finish up more of it, but I sent out a draft PR here #6916

@jedevc

jedevc commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

Just a note - we should probably include a new test for #6951 / similar here, since it has broken a couple of times in the past now (not sure why we didn't do it for #6493).

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Previously it was possible to start a dependent service in one module
API call, and then use it again in a later call, only to have it fail
because it cannot resolve the service address, even though it's still
running. This happened because each invocation has its own client ID,
and client IDs were used to build service addresses.

This change brings service addresses into alignment with the recent
change to uniq them by service ID instead of client ID. The overall
effect is that services are deduped within a Dagger invocation, even
across module calls. So with this change, the service will just stay
running and be re-used by a later call, thanks to the grace period.

Signed-off-by: Alex Suraci <[email protected]>
@sipsma

sipsma commented Apr 30, 2024

Copy link
Copy Markdown
Contributor

This ended up getting cherry-picked into #7213 due to codependence between different changes, so closing out as it's merged

@sipsma sipsma closed this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants