Skip to content

Inconsistent Packet Parsing for Avatar / Region Appearance Due to Aggressive Timeouts Issues #85

@ceriumdynamics

Description

@ceriumdynamics

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:

  1. Run the application under simulated or realworld conditions with variable or poor connectivity or busy sim.
  2. Initiate the avatar appearance load process.
  3. Monitor console logs for the warning about incomplete packet processing
  4. Observe that issue is intermittent and correlates with network delay.

Expected Behavior:

  1. The system should wait not even long enough to receive complete packets before processing.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions