balodesecurity opened a new pull request, #8329:
URL: https://github.com/apache/hadoop/pull/8329

   ## Summary
   
   - `PacketReceiver.MAX_PACKET_SIZE` was set via a `static { new 
HdfsConfiguration(); ... }` initializer. When config resources are loaded from 
HDFS URLs (e.g., during JAR loading via `URLJarFile`), the resulting 
class-loading chain can instantiate `BlockReaderRemote` before `PacketReceiver` 
finishes initializing. The JVM then returns the partially-initialized class 
with `MAX_PACKET_SIZE == 0`, causing every subsequent block read to throw 
`IOException: Incorrect value for packet payload size`.
   - Fix: initialize `MAX_PACKET_SIZE` directly to the compile-time default 
constant (eliminating the static initializer) and add a static 
`setMaxPacketSize(Configuration)` method that `DFSClient` calls during 
construction to apply any operator-configured override. This breaks the 
circular class-loading dependency while preserving configurability.
   
   ## Test plan
   
   - [ ] New tests `TestPacketReceiver#testMaxPacketSizeDefaultIsNonZero` and 
`TestPacketReceiver#testSetMaxPacketSizeFromConfig` pass
   - [ ] All existing `TestPacketReceiver` tests continue to pass


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to