Repository navigation
Use int64_t for task and handler ids (#765) - #768
Merged
Merged
Conversation
PostTask raised OverflowError once its id passed INT_MAX. Also widen the resource handler, web request, string visitor and cookie visitor ids.
7 tasks
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.
Part of #765. Fixes the
PostTask/PostDelayedTaskoverflow and widens the four handler id counters. The JavaScript and Python callback ids are not included.PostTaskandPostDelayedTasktake their id from a global counter. Once it passesINT_MAX,cdef int cTaskId = int(g_taskMaxId)raisesOverflowError, and then every later call fails. At 1000 tasks per second that happens after about 25 days, at 100 per second after about 8 months.task.pyx,extern/task.pxd,client_handler/task.handtask.cpp: the task id isint64_t, includingPyTaskRunnable.cdef publiccallbacks, theGetPy*/GetUser*lookups, the extern constructors and theclient_handlerclasses useint64_t. These counters arecdef int, so they wrap silently instead of raising. This removes the signed overflow (undefined behavior) and the id reuse after 2^32 uses.Not included: the JavaScript and Python callback ids (
g_jsCallbackMaxId,g_pythonCallbackMaxId). They are sent throughCefListValue, which has no 64-bit integer, so they need a different message encoding. See #765.