Server process: use multiple processes
gRPC core is primarily geared towards multithreading, which is not well suited to Python and probably not a first class use case of the Mercurial code base.
Recently, gRPC for Python gained fork support, but it could be for clients only. While working on #1 (closed), I've tried to use simply ProcessPoolExecutor
, as it's mentioned on the fork support page, but it hanged indefinitely.
There's no immediate urgency: for development, using ThreadPoolExecutor
with one worker thread is good enough, but that will have to be taken care of before any final release.
More resources on this: