Skip to content

Row 3028: cleanup writes nothing to a client that is gone - #1524

Merged
neeerp merged 1 commit into
masterfrom
v83/closed-writes-1
Nov 9, 2026
Merged

neeerp merged 1 commit into
masterfrom
v83/closed-writes-1

Conversation

@neeerp

@neeerp neeerp commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Playtest P458 (a trade cut short by a disconnect): the bot quit mid-trade with 2 ores and 10,000 mesos up, and the world logged WARN Failed to finish trade error=I/O error: Broken pipe. finish_trade had already given the offer back (DB checked); only the inventory/meso packets to the gone socket failed.

  • ClientActor.closing, set as cleanup begins; write then returns Ok without touching the socket. Cleanup runs only once the connection is over (disconnect, error, kick, channel change), so nothing it writes could reach the client.
  • Tests on the lane world: trade, personal_shop, mini_games, item_traders, change_channel, hired_merchant, logout_items, messenger_across_channels, mystic_door, party_search, presence_*, buddy_list, cash_shop, guild_bbs pass. (concurrent_login times out at the login server on this 2-core lane box, unrelated: this change is world-only.)

Whatever cleanup tells the client (a trade's offer given back, a shop closed)
went to a socket that may be shut, and a partner leaving a trade by quitting
logged "Failed to finish trade ... Broken pipe". The player still got the
offer back; only the write failed.
@neeerp
neeerp merged commit 1b97014 into master Nov 9, 2026
1 check passed
@neeerp
neeerp deleted the v83/closed-writes-1 branch November 9, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant