Fix OpenComputers/CodeChickenLib network leaks & EnderStorage frequency tracking #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main goal of this PR is to fix the network leaks, which look like
LEAK: ByteBuf.release() was not called before it's garbage-collected
; I found the EnderStorage bug while I was diagnosing the CodeChickenLib (CCL) leak.Fix OpenComputers (OC) not releasing their packets.
ByteBufInputStream
.Fix CCL not releasing their PacketCustom payloads.
FMLEventChannel
but CCL tried to create their networking from scratch off ofFMLEmbeddedChannel
. There was a previous attempt to release the payloads, but it broke mods using the library because some packets are sent to multiple clients through vanilla methods, which means those packets need to have their payloads retained accordingly. You can actually see how this is done properly in Forge'sFMLOutboundHandler
.UTPacketCustomClientMixin
andUTPacketCustomServerMixin
may not be necessary, but I didn't run into any problems by including them. They release the copied payloads inPacketCustom
'sbuf
. The other mixins release the passed in payload, which was the main issue.-Dio.netty.leakDetection.level=paranoid
.io.netty.util.IllegalReferenceCountException
s.Fix EnderStorage adding duplicate
Frequency
entries inTankSynchronizer
.Frequency
broke the Object equality contract by overridinghashCode()
but notequals()
.Debugging the network pipeline is confusing 😢