FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use int64_t for task and handler ids (#765) by linesight · Pull Request #768 · cztomczak/cefpython · GitHub

Repository navigation

Use int64_t for task and handler ids (#765) - #768

Merged
cztomczak merged 2 commits into
cztomczak:masterfrom
linesight:issue765-int64-ids
Nov 25, 2026
Merged

cztomczak merged 2 commits into
cztomczak:masterfrom
linesight:issue765-int64-ids

Conversation

Copy link
Copy Markdown
Contributor

Part of #765. Fixes the PostTask / PostDelayedTask overflow and widens the four handler id counters. The JavaScript and Python callback ids are not included.

PostTask and PostDelayedTask take their id from a global counter. Once it passes INT_MAX, cdef int cTaskId = int(g_taskMaxId) raises OverflowError, 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.h and task.cpp: the task id is int64_t, including PyTaskRunnable.
  • Resource handler, web request, string visitor and cookie visitor: the counters, the cdef public callbacks, the GetPy* / GetUser* lookups, the extern constructors and the client_handler classes use int64_t. These counters are cdef 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 through CefListValue, which has no 64-bit integer, so they need a different message encoding. See #765.

PostTask raised OverflowError once its id passed INT_MAX. Also widen the resource handler, web request, string visitor and cookie visitor ids.
cztomczak merged commit f1e0c6c into cztomczak:master Nov 25, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL