Skip to content

Fix #19: discard clientbound packets sent to dummies - #21

Closed
Bafy78 wants to merge 1 commit into
misode:mainfrom
the-great-chicken:fix/dummy-connection-discard-packets
Closed

Bafy78 wants to merge 1 commit into
misode:mainfrom
the-great-chicken:fix/dummy-connection-discard-packets

Conversation

@Bafy78

@Bafy78 Bafy78 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #19.

DummyClientConnection has no channel, so Connection.isConnected() is always false and vanilla's send(packet, listener, flush), flushChannel() and runOnceConnected() add their work to pendingActions, waiting for a channel that never comes. Every packet addressed to a dummy was kept alive for the dummy's whole lifetime.

This overrides the three methods as no-ops. The one- and two-argument send overloads delegate to the three-argument one, so this covers every outbound path. Packet callbacks never ran before either (the queue was never flushed), so the only observable change is the memory.

Testing

Minecraft 26.3, Fabric API 0.161.0+26.3, dedicated server, 3 GB heap, flat world, 300 armor stands teleported every tick by a repeating command block, 20 dummies; heap measured with jcmd GC.run + GC.heap_info, baseline with no dummy 221–224 MB:

post-full-GC heap dummies just spawned 30 s later
2.7.0 302 MB 368 MB, still climbing
this PR 288 MB 292 MB

Dummies still spawn, walk, respawn and leave. Departed dummies are still retained after dummy leave because of #20; that is fixed separately in the follow-up PR (with both, the heap returns to baseline once the dummies have left).

DummyClientConnection has no channel, so vanilla's send, flushChannel and runOnceConnected queued everything in pendingActions forever; a dummy has no client, drop it instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@misode misode closed this Sep 21, 2026
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.

Dummies keep every packet sent to them in memory (Connection.pendingActions never drains)

2 participants