Repository navigation
Fix Linux TCP listener lifecycle and idle disconnect detection - #3327
ace-code-0 wants to merge 3 commits into
Conversation
[Medium impact] The PR appears safe to merge; the previous listener-stop crash is addressed. SummaryFixes the remaining listener-stop race.
Reviews (2) · Last reviewed commit: "fix: handle listener shutdown race" · Reviewed by Greptile |
| catch (ObjectDisposedException) | ||
| { | ||
| break; | ||
| } | ||
| catch (SocketException) | ||
| { | ||
| break; | ||
| } |
There was a problem hiding this comment.
Stopping listening can crash server
StopListening() can stop the listener after ListenLoop releases _listenerLock but before it calls AcceptTcpClient(). Calling AcceptTcpClient() on a stopped listener throws InvalidOperationException, which neither catch handles. The old blanket catch covered this case. The exception now escapes the thread-pool worker and can terminate the server.
Catch InvalidOperationException for this stop race and exit the loop.
|
@ace-code-0 i will check in under 120 minutes |
|
Thoughts on greptile? |
|
@ace-code-0 please see updated requirements published to discord as of 03:15 JST. If these apply to this PR, please take action accordingly. If you wrote these yourself without AI, please feel free to ignore this.
|
The issue was addressed in |
|
Can you send your repro PoC to ***@***.*** so we can compare this fix against your PoC?
…On Sun, Nov 15, 2026 at 12:56 AM ace-code-0 ***@***.***> wrote:
ace-code-0 left a comment (Pryaxis/TShock#3327)
> Thoughts on greptile?
The issue was addressed in `ecf4ffc`. Greptile's latest review confirms the fix (5/5).
--
Reply to this email directly or view it on GitHub:
#3327 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
|
Incredibly amusing. argo@fluctlight.net is the email. |
|
Sent the reproduction PoC ( |
|
Hi, any updates on the PoC validation? Let me know if any further changes or testing are needed. |
|
I ran an independent validation of this PR (TShock 6.2.1 base
Code notes: unlike #3325 this PR has no TCP keepalive and no Details and table: Pryaxis/TSAPI#284 (comment). |
|
Closing in favor of #3325 and Pryaxis/TSAPI#284, which together passed independent runtime validation. Thanks @defonion for the testing and feedback. |
Changes
Socket.Poll, allowing EOF handling and slot cleanup.Related issue
#3321
Validation
CLOSE_WAITsockets.AI Assistance
Model: GPT-6 (ChatGPT)
Reasoning effort: High
Scope: Debugging, implementation, and review.
Greptile finding addressed in ecf4ffc.