Closed abel-von closed 1 year ago
@abel-von Good catch, this bug is caused by https://github.com/containerd/ttrpc-rust/blob/b13d3fd5423275766e9fd1d929371bd223bedf0f/src/asynchronous/server.rs#L216 and I forgot to close the fd. Would you mind back porting this to 0.5.0, 0.6.0 and 0.7.0? if you are too busy to do it, never mind, I will do it. Thanks a million.
@Tim-Zhang The CI seems to have some wired error, could you help solving it please? I can cherry-pick this to other branches, shall I submit the PR too?
Patch coverage has no change and project coverage change: -0.05
:warning:
Comparison is base (
e94bb9f
) 24.47% compared to head (cc6b187
) 24.42%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@Tim-Zhang The CI seems to have some wired error, could you help solving it please? I can cherry-pick this to other branches, shall I submit the PR too?
It works now.
the listener fd is not closed after the server shutdown, this will make a residual socket fd in the process if it is running different servers again and again.
here I changed the example codes to reproduce it:
if I kill -SIGHUP of this process, we can see that the fd count is increasing:
this PR fix the issue by close the listener fd. this is ok for those calling server.bind() with the socket address, but if the listener is opened from outside, and the lifecycle is managed outside, then it may cause the twice close error. but we can see that the listener is closed in the sync codes. so I think we can assume that the server has taken the ownership of listener fd after it is added into the server.