-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-26175][PYTHON] Redirect the standard input of the forked child to devnull in daemon #25138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -616,6 +616,20 @@ def f(): | |
|
|
||
| self.spark.range(1).select(f()).collect() | ||
|
|
||
| def test_worker_original_stdin_closed(self): | ||
| # Test the original stdin of worker inherit from daemon is closed | ||
|
HyukjinKwon marked this conversation as resolved.
Outdated
|
||
| # and is replaced with '/dev/null'. | ||
| # See SPARK-26175 | ||
| def task(iterator): | ||
| import sys | ||
| res = sys.stdin.read() | ||
| # Because the stdin is replaced with '/dev/null' | ||
|
HyukjinKwon marked this conversation as resolved.
Outdated
|
||
| # Read data from it will get EOF | ||
| assert res == '', "Expect read EOF from stdin." | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify read stdin get EOF immediately. |
||
| return iterator | ||
|
|
||
| self.sc.parallelize(range(1), 1).mapPartitions(task).count() | ||
|
|
||
|
|
||
| class UDFInitializationTests(unittest.TestCase): | ||
| def tearDown(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.