Guarantee FIFO ordering if timestamps are identical. #69
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.
On virtualbox (where system timer seems to have less resolution, perhaps?) we
were seeing native later calls being executed in a different order than they
were scheduled, due to the timestamps being identical and the Callback class
not knowing how to break ties. Now we're keeping count with an integer.
Testing notes
You can run this code in R to check whether the bug exists. I highly recommend restarting the R session after running the test, especially if you intend to run it again, or else you may encounter false positives.
You can also load a Shiny app via Shiny Server (OS or Pro), and use
gdb -p 'pgrep R'
(those single-quotes are intended to be backticks) to attach to the R process. Then hit Refresh repeatedly and quickly in the browser, this should cause a segfault. (On stock SSP setups you'll eventually hit a "Too many concurrent connections", this is an intended feature of SSP and not indicative of a bug.)