Repository navigation
[reve] Process and stream scene data in std::thread instead of civetweb thread - #23631
Conversation
is below 1 MB, the work moves to the new StreamToNewConnection(), run in a std::thread with the default stack size, and the calling thread waits for it. Locking and the order of events are unchanged: the web-server thread holds no locks when the callback is called, and the helper takes fServerState.fMutex exactly as before. An exception is rethrown in the calling thread; if the helper thread cannot be created, the streaming runs in the calling thread as before, with a warning.
…The kCameraCenterOrigin is the default and backward compatible camera center behaviour.
|
@ferdymercury @linev @osschar |
|
Note about the second commit 1443bff: The additional camera center option was introduced related to PR #23556. Due to different use cases camera center (point of orbit movement) can be in the center of bbox or in the origin (0,0,0). With this commit the camera center is preserved to be in origin (0,0,0). The camera center in the overlap visualization macro is set to the center of bounding box. This change is unrelated to reve civetweb change/first commit. |
Test Results 24 files 24 suites 4d 1h 35m 22s ⏱️ For more details on these failures, see this check. Results for commit 1443bff. |
linev
left a comment
There was a problem hiding this comment.
PR fixes the symptoms but not the source of the problem.
There is either an object or an array in the stack that takes up a significant amount of memory, or there is a very deep function call recursion that is "eating" up the stack.
Therefore, one should try to find the reason why the stack is being exhausted.
I agree the change does not fully solves the problem. We did not see it until introduction of builtin civetweb. The stack size went from 8M to 100K. I have clear understanding of stack exhaustion. I will open an issue for this so we dontt forget the problem. |
Fix potential crash using builtin civetweb builder. REveManager uses civetweb server threads. On REveManager::WindowConnect callback all scenes are streamed where size of data can exceed 128K. The WindoConnect callback has the heaviest load.
Solution: Spawn new std::thread REveManager::WindowConnect to prepare scene data and send it to client.
Smaller civetweb stack size has been introduced in april 2026, where civetweb was introduced as a ROOT builtin and with its sources taken from git. See commit 519bb93
Below is Claude report of changes in reduced stack size: