Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: grpc/grpc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.75.0
Choose a base ref
...
head repository: grpc/grpc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.75.1
Choose a head ref
  • 5 commits
  • 71 files changed
  • 2 contributors

Commits on Sep 17, 2025

  1. [Backport][v1.75.x][Python] aio: skip grpc/aio shutdown if py interpr…

    …eter is finalizing (#40649)
    
    Backport of #40447 to v1.75.x.
    ---
    This PR changes the logic of `shutdown_grpc_aio` to skip
    `_actual_aio_shutdown` python interpreter is already [being
    finalized](https://docs.python.org/3.14/glossary.html#term-interpreter-shutdown)
    (cleaning up resources, destroying objects, preparing for program exit,
    etc). `_actual_aio_shutdown` involves `PollerCompletionQueue` shutdown,
    followed by core
    [`grpc_shutdown`](https://grpc.github.io/grpc/core/grpc_8h.html#a35f55253e80714c17f4f3a0657e06f1b)
    API call.
    
    Reasoning:
    1. During finalizations, in come cases resources we're accessing may
    already be freed, and the order is not deterministic. Some of the
    resources being unloaded prior the `_actual_aio_shutdown` call:
    `_global_aio_state`, `AsyncIOEngine` enum, or even python libraries like
    `sys`. This leads to errors like `AttributeError: 'NoneType' object has
    no attribute 'POLLER'`.
    2. `PollerCompletionQueue.shutdown()` will try to wait on its poller
    thread to finish gracefully. In py3.14, `PythonFinalizationError` is
    raised when `Thread.join()` is called during finalization. I think the
    logic here is similar to (1): these threads may have already been
    deallocated.
    
    Note that in some cases users were able to prevent
    `_actual_aio_shutdown` from being called by manually calling
    `init_grpc_aio` prior to initializing any grpc objects. This resulted in
    an incorrect positive refcount, which prevents `_actual_aio_shutdown`
    from being run. Before the above finalization check was added this
    side-effect was sometimes misused to avoid deadlock on finialization
    (#22365).
    
    This PR:
    - Fixes #39520
    - Fixes #22365
    - Fixes #38679
    - Fixes #33342
    - Fixes #36655
    sergiitk authored Sep 17, 2025
    Configuration menu
    Copy the full SHA
    ff24d38 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2025

  1. [Backport][v1.75.x][Python][Support 3.14] Enable 3.14 supported wheels (

    #40726)
    
    Backport of #40403 to v1.75.x.
    ---
    This PR enables Python 3.14 in all the different tests - Basic tests
    (Native Python tests), Bazel tests and Distrib tests to build Python
    3.14 artifacts. In addition, it also updates all the public facing
    METADATA versions.
    
    ## Distribtests
    Required pre-requisite changes to enable 3.14 artifacts are covered in
    #40289 .
    
    ## Bazel tests
    Enabling Python 3.14 required updating the rules_python version to a
    more recent version that supports 3.14. This was done in #40602
    
    ## Basic tests
    The following errors were caught by the Basic tests when running via
    Python 3.14 and resolved in this PR:
    
    ### 1) No running event loop for AsyncIO when run outside an async
    function
    ```
    Traceback (most recent call last):
      File "src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi", line 184, in grpc._cython.cygrpc.get_working_loop
    RuntimeError: no running event loop
    ```
    This was caught by the
    `tests_aio.unit.outside_init_test.TestOutsideInit` and
    `tests_aio.unit.init_test.TestInit` tests, and was also previously
    reported in #39507 with the root cause.
    
    Following some investigation, the fix is being worked on by @sergiitk in
    PR #40293. In order to parallelize the fix and this PR, these 2 tests
    are currently being skipped for Python 3.14 and above.
    
    ### 2) Pickling error from the `multiprocessing` library
    ```
    _pickle.PicklingError: Can't pickle <function _test_well_known_types at 0x7f3937eee610>: it's not the same object as tests.unit._dynamic_stubs_test._test_well_known_types
    when serializing dict item '_target'
    when serializing multiprocessing.context.Process state
    when serializing multiprocessing.context.Process object
    ```
    This was caught by the `tests.unit._dynamic_stubs_test.DynamicStubTest`
    which runs test cases in a subprocess using the `multiprocessing`
    library.
    Error root cause:
    - The default start method of multiprocessing in linux has changed to
    `forkserver` instead of `fork` from Python 3.14.
    - `forkserver` has a few extra restrictions for picklability as compared
    to `fork` (Ref: [Python
    Docs](https://docs.python.org/3.14/library/multiprocessing.html#the-spawn-and-forkserver-start-methods))
    - All the [test case
    functions](https://github.com/grpc/grpc/blob/0243842d5d10f624bf8f09f45026dd300805502f/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py#L115)
    in the DynamicStubTest that are provided as `target` to the
    `multiprocessing.Process` use decorators. This causes problems when
    pickling them.
    
    Hence to resolve this, we manually set the 'start method' of
    `multiprocessing` to use the `fork` start method.
    sreenithi authored Sep 18, 2025
    Configuration menu
    Copy the full SHA
    74ec067 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2025

  1. [Backport][v1.75.x][Python] Handle python3.14 get_event_loop behavior…

    … changes (#40758)
    
    Backport of #40750 to v1.75.x.
    ---
    > [!IMPORTANT]
    > **This fix is only needed to support the use of grpc.aio outside of a
    running event loop.** This approach is [strongly
    discouraged](https://docs.python.org/3.14/library/asyncio-policy.html#asyncio-policies)
    by Python, and will be deprecated in future gRPC releases.
    >
    > Please use the
    [asyncio.run()](https://docs.python.org/3.14/library/asyncio-runner.html#asyncio.run)
    function or the
    [asyncio.Runner](https://docs.python.org/3.14/library/asyncio-runner.html#asyncio.Runner).
    If you see this in Python REPL, use the dedicated [asyncio
    REPL](https://docs.python.org/3/library/asyncio.html#asyncio-cli) by
    running `python -m asyncio`.
    
    This PR handles the following [asyncio behavioral
    changes](https://docs.python.org/3.14/whatsnew/3.14.html#id11)
    introduced in python3.14:
    -
    [asyncio.get_event_loop()](https://docs.python.org/3.14/library/asyncio-eventloop.html#asyncio.get_event_loop)
    now raises a `RuntimeError` if there is no current event loop, and no
    longer implicitly creates an event loop.
    -
    [Deprecations](https://docs.python.org/3.14/whatsnew/3.14.html#deprecated):
    [asyncio.get_event_loop_policy()](https://docs.python.org/3.14/library/asyncio-policy.html#asyncio.get_event_loop_policy),
    [asyncio.AbstractEventLoopPolicy](https://docs.python.org/3.14/library/asyncio-policy.html#asyncio.AbstractEventLoopPolicy),
    [asyncio.DefaultEventLoopPolicy](https://docs.python.org/3.14/library/asyncio-policy.html#asyncio.DefaultEventLoopPolicy).
    Note that this PR preserves the existing behavior and does not migrate
    off of [asyncio policy
    system](https://docs.python.org/3.14/library/asyncio-policy.html) yet.
    This will be done separately, see #39518.
    
    To support 3.14, this PR:
    1. Fixes #39507 by handling the call to deprecated
    `asyncio.get_event_loop_policy()` when calling `new_event_loop()`. This
    was necessary because all warnings were elevated to errors within the
    context manager, and the newly deprecated policy caused an unhandled
    exception.
    2. Handles the `BaseDefaultEventLoopPolicy.get_event_loop()` behavior
    change.
    [Before](https://github.com/python/cpython/blob/v3.13.7/Lib/asyncio/events.py#L695)
    python 3.14, it would only throw `RuntimeError` when there's no loop in
    non-main threads.
    [After](https://github.com/python/cpython/blob/v3.14.0rc3/Lib/asyncio/events.py#L714)
    python 3.14, it removes the special handling of the main thread. This PR
    preserves preserves the pre-3.14 grpc.aio behavior for 3.14.
    
    Co-authored-by: Sergii Tkachenko <[email protected]>
    sreenithi and sergiitk authored Sep 23, 2025
    Configuration menu
    Copy the full SHA
    876e1d1 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2025

  1. [Release] Bump version to 1.75.1 (on v1.75.x branch) (#40773)

    Change was created by the release automation script. See go/grpc-release
    sreenithi authored Sep 25, 2025
    Configuration menu
    Copy the full SHA
    3ab7404 View commit details
    Browse the repository at this point in the history
  2. [Backport][v1.75.x][Fix] PHP macOS build: composer sha sum update, ha…

    …rden install script (#40772)
    
    Backport of #40769 to v1.75.x.
    ---
    Composer sha sum updated, see https://composer.github.io/pubkeys.html
    
    > Installer Checksum (SHA-384)
    `ed0feb545ba87161262f2d45a633e34f591ebb3381f2e0063c345ebea4d228dd0043083717770234ec00c5a9f9593792`
    > Last Updated: 2025-09-18
    
    Also hardens the install script.
    
    Co-authored-by: Sergii Tkachenko <[email protected]>
    sreenithi and sergiitk authored Sep 25, 2025
    Configuration menu
    Copy the full SHA
    9b63ce0 View commit details
    Browse the repository at this point in the history
Loading