endocrimes / nomad-plugin-firecracker

WIP
6 stars 1 forks source link

exec.Stats crashes the plugin process #9

Open plasticine opened 5 years ago

plasticine commented 5 years ago

I found I had to essentially mock this out in order to run workloads without the plugin process crashing out.

https://github.com/dantoml/nomad-plugin-firecracker/blob/cee15baa9d814df5ff06bfdc9e54bd38659f4dbd/plugin/plugin.go#L364-L371

[DEBUG] client.driver_mgr.firecracker: panic: runtime error: invalid memory address or nil pointer dereference: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xb7f55e]: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: : driver=firecracker
[DEBUG] client.driver_mgr.firecracker: goroutine 43 [running]:: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/plugin.(*Driver).TaskStats(0xc0002fa080, 0xe76160, 0xc0004b4540, 0xc000492580, 0x35, 0x3b9aca00, 0x10, 0x10, 0xcfd900): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/plugin/plugin.go:370 +0x5e: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/vendor/github.com/hashicorp/nomad/plugins/drivers.(*driverPluginServer).TaskStats(0xc0002fa200, 0xc000482340, 0xe78760, 0xc0004e87a0, 0xc0002fa200, 0x8ed6fb): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/github.com/hashicorp/nomad/plugins/drivers/server.go:230 +0x14a: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/vendor/github.com/hashicorp/nomad/plugins/drivers/proto._Driver_TaskStats_Handler(0xd1e2e0, 0xc0002fa200, 0xe77c80, 0xc0000315c0, 0x152e940, 0xc0004b4540): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/github.com/hashicorp/nomad/plugins/drivers/proto/driver.pb.go:3260 +0x109: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc.(*Server).processStreamingRPC(0xc000136a80, 0xe79900, 0xc000137680, 0xc000255b00, 0xc0002a92c0, 0x14fa960, 0x0, 0x0, 0x0): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc/server.go:1170 +0xac7: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc.(*Server).handleStream(0xc000136a80, 0xe79900, 0xc000137680, 0xc000255b00, 0x0): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc/server.go:1249 +0xcfa: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0002f27e0, 0xc000136a80, 0xe79900, 0xc000137680, 0xc000255b00): driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc/server.go:685 +0x9f: driver=firecracker
[DEBUG] client.driver_mgr.firecracker: created by github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc.(*Server).serveStreams.func1: driver=firecracker
[DEBUG] client.driver_mgr.firecracker:         /Users/justin/go/src/github.com/dantoml/nomad-plugin-firecracker/vendor/google.golang.org/grpc/server.go:683 +0xa1: driver=firecracker
[ERROR] client.driver_mgr.firecracker: reading plugin stderr: driver=firecracker error="read |0: file already closed"
endocrimes commented 5 years ago

Oops - sorry that was an artifact of a refactor i was working on previously, fixed in #10 though