Closed amukherj closed 6 years ago
My analysis suggests the following:
This line:
https://github.com/hellofresh/janus/blob/3.7.1-rc.24/pkg/server/server.go#L113
expects the register
member of s.defLoader
to be initialized by an earlier call to the goroutine here:
https://github.com/hellofresh/janus/blob/3.7.1-rc.24/pkg/server/server.go#L83
which ultimately calls this line:
https://github.com/hellofresh/janus/blob/3.7.1-rc.24/pkg/server/server.go#L163
But there is no synchronization to guarantee a happens-before relationship, and on the rare occasion that this order is flipped, we get the core dump.
@vgarvardt @italolelis Any thoughts on this?
Thank you for the report. I'll take a look at it as soon as I can.
@amukherj I just merged https://github.com/hellofresh/janus/pull/350 that should fix the issue. This issue seems to be continuation/leftover after fix from https://github.com/hellofresh/janus/pull/339.
Thank you for your report and investigation!
Occasionally on startup, Janus dumps core and exits. This is particularly observed in container environments but occasionally also seen with the standalone binary.
Reproduction Steps:
Create a docker image using the following Dockerfile, running in a directory with the following layout:
dist/janus_linux-amd64 apis/apispec.json conf/janus.toml certs/janus.crt certs/janus.key
The above Dockerfile is for informational purposes only.
Expected behavior:
Janus should come up and start serving the configured endpoints.
Observed behavior:
Normally Janus works as expected, but occasionally it dumps the following core.
On startup, Janus dumps the following core:
Janus version: 3.7.1-rc.24 OS and version: CentOS Linux release 7.4.1708 (Core)