[FLINK-39572][python] Do not log the Beam environment payload - #29225
Merged
Merged
Conversation
The copy of Beam's DefaultJobBundleFactory maintained in flink-python logged the whole RunnerApi.Environment when closing, expiring or failing to clean up an environment. For process environments the payload carries every environment variable of the Python worker, which is inherited from the TaskManager, so the TaskManager log contained all of them. Only the environment's urn is logged now. Generated-by: Claude Code (Claude Fable 5.1)
… worker explicitly The worker process inherits the TaskManager's environment through the ProcessBuilder Beam starts it with, so copying the whole environment into the process payload only put every variable into what Beam describes when it closes an environment. Only the variables the environment manager sets are passed on explicitly now. Generated-by: Claude Code (Claude Fable 5.1)
Collaborator
dianfu
approved these changes
Sep 18, 2026
dianfu
left a comment
Contributor
There was a problem hiding this comment.
@MartijnVisser Thanks for the PR. LGTM.
dianfu
pushed a commit
that referenced
this pull request
Sep 18, 2026
The copy of Beam's DefaultJobBundleFactory maintained in flink-python logged the whole RunnerApi.Environment when closing, expiring or failing to clean up an environment. For process environments the payload carries every environment variable of the Python worker, which is inherited from the TaskManager, so the TaskManager log contained all of them. Only the environment's urn is logged now. Generated-by: Claude Code (Claude Fable 5.1)
dianfu
pushed a commit
that referenced
this pull request
Sep 18, 2026
The copy of Beam's DefaultJobBundleFactory maintained in flink-python logged the whole RunnerApi.Environment when closing, expiring or failing to clean up an environment. For process environments the payload carries every environment variable of the Python worker, which is inherited from the TaskManager, so the TaskManager log contained all of them. Only the environment's urn is logged now. Generated-by: Claude Code (Claude Fable 5.1)
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.
What is the purpose of the change
flink-python's copy of Beam's
DefaultJobBundleFactorylogged the wholeRunnerApi.Environment, whose process payload holds every environment variable of the Python worker, i.e. of the TaskManager. See FLINK-39572.Brief change log
ProcessBuilder, as before.Verifying this change
This change added tests and can be verified as follows:
DefaultJobBundleFactoryTestruns the real close path with a marker variable in the payload; red without the first commit.ProcessPythonEnvironmentManagerTest#testProcessEnvironmentOnlyContainsManagedVariables; red without the second.test_dependency.py::test_set_environmentnow reads a variable set before the gateway JVM starts, so inheritance is covered.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5.1)