You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: I was working on the final PR for passing sockets as args and had a bug that caused the Tunnel in c2h.go to return an error. That was just a bug in the WIP code, but the failure mode I saw was very weird and repros on main: the session close timed out.
After questioning my fundamental sanity for a while, I finally realized that for some reason the service stop callback got called multiple times in this error case, which is bad because it does a select on an exited channel that will already have been read from on the second call:
This is definitely wrong. But this is a tangent on a tangent and not blocking my efforts atm so I'm just opening this issue so I don't forget to go back and look more and fix it. It's one of those things that might be simple (just save the exited error in a var rather than using a chan) or might be a deeper problem with more wide ranging effects (is it supposed to be okay to call stop multiple times in the first place? etc.). I'm just not sure until I look more.
cc @vito@jedevc, just an FYI in case this rings any bells
To easily repro on main you can apply this diff that simulates an error in the tunneling:
Context: I was working on the final PR for passing sockets as args and had a bug that caused the Tunnel in
c2h.go
to return an error. That was just a bug in the WIP code, but the failure mode I saw was very weird and repros on main: the session close timed out.After questioning my fundamental sanity for a while, I finally realized that for some reason the service stop callback got called multiple times in this error case, which is bad because it does a select on an
exited
channel that will already have been read from on the second call:exited
chan in question:dagger/core/service.go
Line 651 in d7c68db
This is definitely wrong. But this is a tangent on a tangent and not blocking my efforts atm so I'm just opening this issue so I don't forget to go back and look more and fix it. It's one of those things that might be simple (just save the exited error in a var rather than using a chan) or might be a deeper problem with more wide ranging effects (is it supposed to be okay to call stop multiple times in the first place? etc.). I'm just not sure until I look more.
cc @vito @jedevc, just an FYI in case this rings any bells
To easily repro on main you can apply this diff that simulates an error in the tunneling:
You'll see in engine logs that the stop count goes to 2.
The text was updated successfully, but these errors were encountered: