Network cleanup: consolidate input/output streams#10664
Open
MostCromulent wants to merge 1 commit into
Open
Conversation
Drops ReplacingOutputStream/ResolvingInputStream — wrapEvents, unwrapEvents, measureSize now go through CObjectOutputStream and CObjectInputStream. Thin descriptors don't carry serialVersionUID, so the Android record UID fallback is gone with them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Comment on #10662 asked whether
TrackableSerializer.ReplacingOutputStream/ResolvingInputStreamwere still needed once the outer-pipelineCObjectOutputStream/CObjectInputStreamhad grown the Tracker/consumerId plumbing.They weren't — the inner pair only served three call sites (
wrapEvents,unwrapEvents,measureSize), all of which can be expressed in terms of the outer codec. The inner pair wrote fullObjectStreamClassblocks, carryingserialVersionUIDon the wire — which is what the Android records workaround inResolvingInputStream.readClassDescriptorhad to compensate for (JVM keeps records at0L, d8 desugars records with a computed UID).CObjectOutputStreamwrites thin descriptors — a one-byte tag plus the UTF class name — so no UID travels on the wire and the disagreement never surfaces.Routing the three inner call sites through
CObjectOutputStream/CObjectInputStreammakes the workaround unreachable, and it's deleted with the classes.Implementation
CObjectOutputStreamgains aneventModeparameter so it can serve as both the outer-pipeline encoder (IdRefsubstitution) and the event-wrap encoder (EventCardRefsubstitution). The single outer caller inCompatibleObjectEncoderpassesfalse.wrapEventsswitches tonew CObjectOutputStream(baos, true, tracker, -1, true).unwrapEventsswitches tonew CObjectInputStream(bais, INNER_CLASS_RESOLVER, tracker).measureSizeswitches and gains exception-safe try-with-resources.INNER_CLASS_RESOLVERis a staticClassResolvers.cacheDisabled(null)onTrackableSerializer, matching what the outer Netty pipeline uses inFServerManager/FGameClient.ReplacingOutputStreamandResolvingInputStreamare deleted, taking the UID-mismatch fallback with them.Testing completed
🤖 Generated with Claude Code