[GRASS-git] [OSGeo/grass] e39fb8: grass.pygrass: Pin fork start method for RPC serve...

Anna Petrasova noreply at github.com
Thu Sep 24 07:14:31 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: e39fb8c0e4eb7c3085c8e4619671923096a6c892
      https://github.com/OSGeo/grass/commit/e39fb8c0e4eb7c3085c8e4619671923096a6c892
  Author: Anna Petrasova <kratochanna at gmail.com>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M python/grass/pygrass/messages/__init__.py
    M python/grass/pygrass/rpc/__init__.py
    M python/grass/pygrass/rpc/base.py
    M python/grass/script/tests/utils_test.py
    M python/grass/script/utils.py
    M python/grass/temporal/c_libraries_interface.py
    M python/grass/temporal/extract.py
    M python/grass/temporal/mapcalc.py
    A python/grass/temporal/tests/grass_temporal_c_libraries_interface_start_method_test.py

  Log Message:
  -----------
  grass.pygrass: Pin fork start method for RPC servers on Python 3.14 (#7724)

Python 3.14 changed the default multiprocessing start method from fork
to forkserver on all platforms except macOS (python/cpython#84559).
The RPC servers in grass.pygrass.rpc and grass.temporal rely on fork:
their worker processes call libgis via ctypes and must inherit the
initialized library state and the GRASS session environment from the
parent. Under forkserver the worker is forked from an early, clean
process without the GRASS runtime, and the forkserver socket teardown
raises FileNotFoundError in the server-checker thread.

Define a shared multiprocessing context in grass.pygrass.rpc.base that
pins fork where it was the previous default, and reuse it in the three
start_server implementations. macOS (already spawn) and Windows (no
fork) keep their default start method, so the change is a no-op there
and on Python <= 3.13.

Root-caused and drafted with the help of Claude (Opus 4.8).

Co-authored-by: Vaclav Petras <wenzeslaus at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list