Repository navigation
Conversation
Contributor
Author
|
/gemini review |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41629 +/- ##
=========================================
Coverage 58.05% 58.05%
Complexity 2844 2844
=========================================
Files 1210 1210
Lines 173280 173280
Branches 2329 2329
=========================================
+ Hits 100604 100605 +1
+ Misses 69964 69963 -1
Partials 2712 2712
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
Passes
("grpc.so_reuseport", 0)to ephemeral-port gRPC servers created by the Python portability runner (GrpcServer,LocalJobServicer,SubprocessSdkWorker, andUberJarBeamJob) so distinct servers cannot share a port on Linux.Production Impact
This changes production gRPC server setup in the Python portability /
FnApiRunner/ local job service stack (worker_handlers.py,local_job_service.py,abstract_job_service.py). Previously, on Linux, gRPC's defaultgrpc.so_reuseport=1allowed multiple independent ephemeral-port servers (control, data, state, logging, job service, or artifact staging) running under the same user—whether in the same process or across concurrent jobs/workers on the same host—to collide on the same port and silently misroute RPCs to the wrong servicer withStatusCode.UNIMPLEMENTED: Method not found!. Explicitly setting("grpc.so_reuseport", 0)guarantees exclusive port allocation for each server without affecting single-server behavior or non-Linux platforms.Root Cause
In
PreCommit Python Runners(run45413523150),PortableRunnerTestWithSubprocesses.test_batch_rebatch_pardos_into_multi_column_batchesfailed when the subprocess SDK worker'sBeamFnData.Datastream tolocalhost:45943terminated with:Because
grpc.server()enablesSO_REUSEPORTby default on Linux, two distinct gRPC servers binding ephemeral ports ([::]:0/localhost:0) under the same UID (such as parallelpytest -n 6workers or the four separate servers insideGrpcServer) can receive the same port from the kernel. Incoming connections are then hashed across both listeners, routing aBeamFnDataRPC to a server that only implements another service (e.g., control, state, logging, or job service).Fix
("grpc.so_reuseport", 0)to the gRPC server options in:sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py(GrpcServer.__init__)sdks/python/apache_beam/runners/portability/local_job_service.py(LocalJobServicer.start_grpc_serverandSubprocessSdkWorker.run)sdks/python/apache_beam/runners/portability/abstract_job_service.py(UberJarBeamJob._start_artifact_service)grpc.servercannot bind any port owned byGrpcServer(WorkerHandlerManagerTest.test_grpc_server_disables_so_reuseport) orLocalJobServicer(LocalJobServerTest.test_grpc_server_disables_so_reuseport).Verification
yapf --style setup.cfg --diffacross all 5 modified files (clean).pytest:worker_handlers_test.py+local_job_service_test.py(6 passed, including both newSO_REUSEPORTtests).flink_uber_jar_job_server_test.py(6 passed).portable_runner_test.py -k "PortableRunnerTestWithSubprocesses and test_batch_rebatch_pardos_into_multi_column_batches"(2 passed).Recent Occurrences
1 failing
masterworkflow run in the past 3 weeks:PreCommit Python Runners(3.14):Verification
beam_PreCommit_Python_Runners.ymlworkflow run on branch:45437029119