zhboner / realm

A network relay tool
MIT License
1.54k stars 285 forks source link

Cannot Accept TCP Traffic after Showing Strange Error #92

Closed G5Hg3EmMa9ss97 closed 1 year ago

G5Hg3EmMa9ss97 commented 1 year ago

Hi, I'm using realm to forward traffic to remote host with args -l 0.0.0.0:234 -r dst-ip-addr:234 --udp --send-proxy.

Realm will stop forwarding traffic after [realm_core::tcp][ERROR][tcp]failed to accept: Connection aborted (os error 103) was printed on the screen. I'm not sure whether this is the reason why it stops forwarding TCP traffic but I can't see other logs that maybe related to this issue. This issue can be reproduced on other servers.

I can't find the reason based on your docs and codes. So I was wondering whether you can offer me some help on this issue? Please let me know if I can help more.

G5Hg3EmMa9ss97 commented 1 year ago

I just set the log level to trace. Will report here if more trace back log can be provided.

G5Hg3EmMa9ss97 commented 1 year ago

I'm afraid setting log level to trace can't provide more log.

[realm_core::tcp][ERROR][tcp]failed to accept: Connection aborted (os error 103)\
[mio::poll][TRACE]deregistering event source from poller
zephyrchien commented 1 year ago

Thank you for your detailed description. A recent commit has changed the behavior when accept error occurs, since then Realm exits directly to avoid falling into an infinite loop(accept always fails). In fact some errors are recoverable, we should handle them correctly.

Reference, https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-handle-econnaborted-with-accept-system-call-330829/#post1681072

G5Hg3EmMa9ss97 commented 1 year ago

Thank you for the reply. So I can assume that it is Realm that actively stops forwarding traffic to destination and this is an expected behavior?