Conversation
|
@mdlayher gentle bump |
mdlayher
left a comment
There was a problem hiding this comment.
LGTM, sorry I missed this. To clarify this all works as you'd expect in your calling code? I ask because I attempted context plumbing in mdlayher/socket and I think I got a lot of it right but I haven't heavily exercised it with every system call.
|
I can't speak for every case around, but the same worked for AWS VSOCKs, which is definitely a sub case of the more general VSOCK support. Anyways, the context is being passed to the |
|
I'm actually not sure why actions isn't running here, let me see. |
|
I'm good with this but will want to get CI updated first. Will set a reminder. |
|
The placeholder function for diff --git a/vsock_others.go b/vsock_others.go
index 5c1e88e..d46fb90 100644
--- a/vsock_others.go
+++ b/vsock_others.go
@@ -4,6 +4,7 @@
package vsock
import (
+ "context"
"fmt"
"net"
"os"
@@ -26,7 +27,7 @@ func (*listener) Addr() net.Addr { return nil }
func (*listener) Close() error { return errUnimplemented }
func (*listener) SetDeadline(_ time.Time) error { return errUnimplemented }
-func dial(_, _ uint32, _ *Config) (*Conn, error) { return nil, errUnimplemented }
+func dial(_ context.Context, _, _ uint32, _ *Config) (*Conn, error) { return nil, errUnimplemented }
type conn struct{} |
This PR simply implements a function
DialContextso that a context can be used to terminate the dialing. VSOCK has lower chances to delay obtaining a response while dialing, but it can still occur.Moreover, it is important to be supported while integrating with
go-libp2p. Check github.com/balena/go-libp2p-vsock. It allows enclaves to dial remotelibp2pnodes by means of relays.