A ServerDB message dropped by the full receive queue never reaches the receive observers and its drop line names no message

Open Beginner friendly
#2,376 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Start with src/runtime/server/websocket_frame.cpp and src/runtime/server/websocket_client.cpp, then add the falsifier described in the issue: deliver a frame that exceeds the 1024-message receive queue with a receive observer attached. Check that the observer sees the first dropped message and that the warning includes its id and the dropped count; run the relevant GTest to verify.

Written by the indexing model from the issue text.

Description

bug

Evidence at 0c3068d41

  • src/runtime/server/websocket_frame.cpp:72-79 (ParseServerDbFrame): once result.messages.size() >= queueLimit it sets WebSocketFrameStatus::QueueLimit, records the first dropped message's id and length, and stops; the later messages of the frame are not parsed into result.messages.
  • src/runtime/server/websocket_client.cpp:288-298 (OnMessage, Message case): receiveObserver_ is called only over parsed.messages, so a message past the limit never reaches the receive observer (the ended-session watchdog and the registration-answer tracker, #2374).
  • src/runtime/server/websocket_client.cpp:332-340: the only record is one Warning Receive queue full (1024) — remaining frame messages dropped, with no message id, no count and no reconnect count; the id and length ParseServerDbFrame recorded are discarded.

Not shown

That a live server's queue ever fills: the game thread drains it in GameServerLib::Update, and no run has been observed to reach 1024 queued messages.

Falsifier

A GTest that delivers a frame whose first message after the free capacity is a registration refusal (or a session-ended message) to a WebSocketClient whose receive queue holds 1024 messages, with a receive observer attached, and finds the observer called for it and a Warning naming its message id: it fails on 0c3068d41 (the observer is not called, the line names no id) and would pass after the fix.

Work

  1. Test first, as the falsifier says.
  2. Run the receive observer over every parsed message including those the queue cannot take (they are still dropped from the game-thread queue), and put the first dropped message's id (errorMessageId) and the dropped count in the Warning.
Dominant language
C++
Stars
2
Forks
5
Avg merge
4h 21m
Merged PRs (30d)
801

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.