Conversation
6cde672 to
7a47037
Compare
|
@jstarks Was satisfying the almighty linter, ready for eyes again |
|
Otherwise LGTM |
a337f5f to
2c2ea85
Compare
| f, err := ioutil.TempFile("", "") | ||
| if err != nil { | ||
| return nil, errors.Wrap(err, "failed to create temp file for unix socket") | ||
| } | ||
|
|
||
| if err := f.Close(); err != nil { | ||
| return nil, errors.Wrap(err, "failed to close temp file") | ||
| } | ||
|
|
||
| if err := os.Remove(f.Name()); err != nil { | ||
| return nil, errors.Wrap(err, "failed to delete temp file to free up name") | ||
| } |
There was a problem hiding this comment.
Is the point of this just to get a unique path to use?
There was a problem hiding this comment.
Yes, could make a comment about this.
There was a problem hiding this comment.
we don't care about putting these anywhere specific in case of issues where files aren't cleaned up or something? Maybe in the C:\ContainerPlatData dir like the container IO files or something?
There was a problem hiding this comment.
I don't think we should place them in a directory containerd maintains, but I'm not too worried about this in general. The way we setup the io channels is to just close the listener the second we accept a connection (which removes the socket file anyways).
There was a problem hiding this comment.
The socket file itself is removed the second you'd close the listener, but the connection is still valid. For a quick hacked up example.
func echo(c net.Conn) {
for {
buf := make([]byte, 512)
nr, err := c.Read(buf)
if err != nil {
log.Fatal(err)
}
data := buf[0:nr]
fmt.Printf("Received: %v\n\n", string(data))
}
}
func main() {
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT)
l, err := net.Listen("unix", `/test.sock`)
if err != nil {
log.Fatal(err)
}
conn, err := l.Accept()
if err != nil {
log.Fatal(err)
}
// Socket file removed after this line, can still utilize the conn we have but the listeners
// done for (can't accept any further conns).
l.Close()
go echo(conn)
select {
case <-sigChan:
log.Print("Received signal, closing.")
}
}Where the listener we return in this func is eventually used is here: https://github.com/microsoft/hcsshim/blob/master/internal/gcs/iochannel.go#L14-L27
So I don't have many worries about socket files not being cleaned up.
Add an implementation of the vm.UVM interface using the vmservice ttrpc definitions. Fix up cpugroup HypervisorId type to be a uint64 Signed-off-by: Daniel Canter <dcanter@microsoft.com>
|
@katiewasnothere Remedied, thanks! |
Remotevm UVM implementation
Add an implementation of the vm.UVM interface using the vmservice ttrpc
definitions.
Signed-off-by: Daniel Canter dcanter@microsoft.com