-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Encountering persistent packet parsing errors during avatar appearance loads. The system logs the following warning:
WARNING: Finished reading AvatarAppearance but we're not at the end of the packet (pos < buf.length, seq XYZ)
This warning indicates that the packet parser in Packet.readFromBuffer does not consume the entire buffer, resulting in incomplete data processing.
Suspected Root Causes:
The core system currently enforces a 10-sec timeout for requests. In addition, the resend timeout for reliable packets is set to 1000ms and file transfer timeouts are set to 10000ms in the Circuit class.
These values may be too low in environments with high latency or variable network conditions, causing partial packet reception and premature parsing.
The waitForAck mechanism, which also relies on these timeout settings, might be triggering too early, resulting in missed acknowledgments.
Steps to Reproduce:
- Run the application under simulated or realworld conditions with variable or poor connectivity or busy sim.
- Initiate the avatar appearance load process.
- Monitor console logs for the warning about incomplete packet processing
- Observe that issue is intermittent and correlates with network delay.
Expected Behavior:
- The system should wait not even long enough to receive complete packets before processing.
- Adjusting timeouts to longer durations (e.g. 30-60 sec for general requests, and possibly up to 300 sec for some file transfers) should reduce or eliminate these errors.
Environment:
Node.js Version: 20
node-metaverse Commit/Version: 64359a3
Operating System: Docker Alpine-amd64 / Docker Alpine-arm64
Proposed Solutions
Increase Timeout Values:
Modify the timeout durations in the Circuit class (eg. increase the resend timeout and file transfer timeouts), make sure that waitForAck in it's place.