Repository navigation
Conversation
The framer only printed a received message to stdout while the internal message queue had room, and queued every message. Nothing in the server ever reads that queue, so it was full after 65535 messages (about an hour with four sensors). From then on no message reached the host any more, while the USB stick kept receiving and the server kept answering requests, so the host could not tell that the stick was no longer being served. Forward each message right away and do not queue it. Also write every stdout line in one piece under a lock. The thread that reads requests and the thread that receives from the stick wrote to stdout at the same time, which could mix up two lines and make the host reject a truncated message. The server has to be rebuilt with Visual Studio (toolset v140) to take effect. Not compiled in this change; the output helper was checked with g++ -std=c++11 including a two-thread stress test.
Builds antserver/ with the same SDK sources and the MSVC v140 toolset, fails if the binary depends on a newer runtime than the one the desktop app ships, smoke-tests the ping echo and uploads ANTserver.bin as an artifact.
bBursting was never initialized. Members are now set in the initializer list. The server object in main is deliberately kept alive until the process ends; marked so that the analysis does not report it as a leak.
2 of 3 tasks
Built by the antserver workflow (run 45451739207) from 6b02fb6, MSVC v140, SHA-256 7d7452f37c0358ebc09694f1c8721f03c4f2b34a81f971f051c96260d8910777.
…gain The framer and serial objects were created with new on every open and never freed, about 3 MB per open. They are now owned by unique_ptr and released (receive thread of the stick first) before the next open and on destruction. Members are initialized where they are declared. The smoke test now also opens and closes the device twice and checks that the server still answers.
Built by the antserver workflow (run 45458021987) from 6a05f12, MSVC v140, SHA-256 c4a50f7f77ff4cad1c42a1ff1ae3b4595fae4dff466216aacf17a93286044c36.
|
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
On Windows the ANT+ server (
AntServer.bin) stops forwarding ANT messages after 65535 messages, which is about an hour of riding with four sensors. The USB stick keeps receiving and the server keeps answering requests (including the heartbeat echo), so the app cannot tell, loses all sensors and only recovers after the app is restarted.Cause
The framer queued every received message and only printed it to stdout while the queue had room. Nothing in the server ever reads that queue, so it was full after 65535 messages and from then on nothing was printed.
What changed
Illegal messageon the host side).antserver.exewith the same SDK sources and the MSVC v140 toolset, fails if the binary needs a newer runtime than the one the desktop app ships, smoke-tests the heartbeat echo and uploadsANTserver.binas an artifact.Test plan
ANTserver.bin: data keeps flowing