ntcore
ntcore copied to clipboard
NetworkTables writes hang if flush is used more often than the update rate
If a user calls flush lots of times faster than the update rate, and then stops calling flush, the dispatcher won't send new values to the network connections for a potentially long period of time. It does not affect reads.
I ran into this with pynetworktables, but haven't yet verified the issue with ntcore itself. It's pretty easy to see at https://github.com/wpilibsuite/ntcore/blob/3025a182ccc087e43ac71c1f539d05e2d5e0c28d/src/main/native/cpp/Dispatcher.cpp#L303 . Every time a flush occurs, the timeout period is incremented by the update rate.
This is a really difficult bug to trigger, and I don't expect many users will run into it, so I don't recommend a fix released until after CMP. For users that may be affected by this bug, a workaround is to continue calling flush periodically.