Hi team, my team and I came through a serious fail...
# contributors
b
Hi team, my team and I came through a serious failure in our side due to how the jsonnet pool is handled. We’d like to contribute with a fix but first we wanted to validate with you if it makes sense, following the code contribution guidelines. Let me share our findings: we experienced resource allocations issues for the jsonnet processes and we also saw zombie processes. After some checks through the
ory/x
repo, we found these lines of code: https://github.com/ory/x/blob/f208671af4e8c43decd7a239851f9cbb5ce34794/jsonnetsecure/jsonnet_pool.go#L163-L166
Copy code
func (w worker) destroy() {
	close(w.stdin)
	w.cmd.Process.Kill()
}
we are concerned that this
cmd.Process.Kill
without also calling
Cmd.Wait
might be contributing to what we are experiencing. According to go documentation, after a successful call to
Start
, the
Cmd.Wait
method should be called. Do you think this is a valid concern? I would be happy to contribute and try to fix this issue. Let me know!! Thanks in advance
s
It could be the case if the kill signal does not get properly processed maybe. We haven't observed anything similar on Ory Network, so maybe this is more specific to your setup. It would be great if you could first recreate the behavior in a unit test, e.g. with some artificial
time.Sleep
.
b
thanks for the reply @steep-lamp-91158. For us (we are using self-hosted) it started to be a problem (we didn’t even notice before) when we enabled the tokenizer to issue JWT for auth
r
I suppose a call to
cmd.Wait()
can't hurt there, since we
kill -9
the process which should be nearly instantaneous.
Not sure if this solves the issue of zombie processes tho
This change was merged to Kratos.