Skip to content

Not possible to restart internal go server #107

@Limess

Description

@Limess

We've seen an issue where for some reason the internal go server started by hrequests.cffi stops unexpectedly. We subsequently see Connection refused errors for every request.

As a workaround, we intended to try to stop and then relaunch the go server, however this is not currently possible as we can't re-register the http handlers:

panic: http: multiple registrations for /request
goroutine 20 [running]:
[github.com/bogdanfinn/fhttp.(*ServeMux).Handle(0x110cd15c0](http://github.com/bogdanfinn/fhttp.(*ServeMux).Handle(0x110cd15c0), {0x11081e09e, 0x8}, {0x1109ba948, 0x1109b77a0})
	/go/pkg/mod/github.com/bogdanfinn/fhttp@v0.5.29/server.go:2473 +0x1f0
[github.com/bogdanfinn/fhttp.(*ServeMux).HandleFunc(...)](http://github.com/bogdanfinn/fhttp.(*ServeMux).HandleFunc(...))
	/go/pkg/mod/github.com/bogdanfinn/fhttp@v0.5.29/server.go:2510
[github.com/bogdanfinn/fhttp.HandleFunc(...)](http://github.com/bogdanfinn/fhttp.HandleFunc(...))
	/go/pkg/mod/github.com/bogdanfinn/fhttp@v0.5.29/server.go:2522
main.startServer({0x116e9aa18, 0x5})
	/source/server.go:203 +0xb8
created by main.StartServer in goroutine 17
	/source/server.go:216 +0x68

ideally there would be

  • some internal mechanism to restart the server on failure
  • logs which are propagated to python for starting/stopping the server
  • a way in userland to restart the server without errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions