Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21094][PYTHON] Add popen_kwargs to launch_gateway - #18339
Conversation
holdenk
commented
Jul 2, 2017
This is interesting, I've got a similar approach I've been working on in #17298 which has some issues inside of PyPI. Would that suit your needs if I extended it to allow you to enable it manually in addition to when the pipe was overloaded? Let me know. In the meantime, jenkins ok to test. |
parente
commented
Jul 3, 2017
Oh neat. #17298 looks similar to the approach we took in spylon-kernel to launch with stdout/stderr pipes redirected to the parent process and threads to read them (https://github.com/maxpoint/spylon-kernel/blob/master/spylon_kernel/scala_interpreter.py#L73). That project is based on Calysto/metakernel, which has an API for sending stdout/stderr back to kernel clients, so we use that instead of I still think it would be handy to give clients more control over how the py4j gateway is launched. For instance, if I want to use pyspark in an asyncio application, I might want to open pipes to the jvm process, but then switch them to non-blocking IO mode and hook them up to an async reader. If #17298 merges without a making the threads optional and exposing the pipes for the caller to use, it's likely to be more harmful than helpful in the async situation. |
holdenk
commented
Jul 6, 2017
The approach taken in https://github.com/maxpoint/spylon-kernel/blob/master/spylon_kernel/scala_interpreter.py#L73 is interesting (and definitely not supported) - so making it easier for kernels to get at the JVM logs as needed seems worthwhile. That being said if the messages are piped through from the JVM to the existing stderr/stdout pipes would that be sufficient? |
holdenk
commented
Sep 6, 2017
Jenkins ok to test. |
There was a problem hiding this comment.
I'd make this _popen_kwargs to indicate it's usage is possibly not super supported.
There was a problem hiding this comment.
Would a comment in the docstring to that effect be better? I haven't seen _var_name used in Python projects to indicate a developer feature. (But of course, maybe I've just not seen it yet!)
There was a problem hiding this comment.
Mention that this is a developer feature and may change in future versions.
There was a problem hiding this comment.
And ... you already noted what I just commented above. Doh! I'll update the docstring at least.
SparkQA
commented
Sep 6, 2017
Test build #81472 has finished for PR 18339 at commit
|
holdenk
commented
Sep 8, 2017
Let's get some extra eyes on this, maybe @davies or @HyukjinKwon want to take a quick look? I think it makes sense as an advanced developer API but I'm open to other ideas. |
SparkQA
commented
Sep 9, 2017
Test build #81570 has finished for PR 18339 at commit
|
HyukjinKwon
commented
Sep 9, 2017
Thanks for cc'ing me. To me, I think I can follow the discussion and the motivation here but I think I am neutral (rather -0) as |
holdenk
commented
Nov 18, 2017
Jenkins OK to test. |
HyukjinKwon
commented
Nov 19, 2017
I am okay with going ahead @holdenk if you think it's okay anyway. |
HyukjinKwon
commented
Nov 19, 2017
retest this please |
SparkQA
commented
Nov 19, 2017
Test build #83998 has finished for PR 18339 at commit
|
holdenk
commented
Feb 28, 2018
Lets see what @BryanCutler thinks |
HyukjinKwon
commented
Jun 9, 2018
ok to test |
SparkQA
commented
Jun 9, 2018
Test build #91604 has finished for PR 18339 at commit
|
holdenk
commented
Jun 28, 2018
@HyukjinKwon what re-triggered your interest in this PR? |
Jenkins left a comment asking like "Can one of the admins verify this patch?" again. I was thinking it's worth given your comment above so I just triggered the build again .. I am not sure why / when / who about Jenkins leaving those comments again to some particular PRs. I was thinking about asking this into dev mailing list if happens one more time. |
holdenk
commented
Oct 26, 2018
Since @HyukjinKwon's concerns for this PR have been addressed if @parente can update this to master would be lovely to get this in for 3+ since I'm working on some multi-language pipeline stuff which could benefit. |
@holdenk Took a note to look at it this weekend. |
Allow the caller to customize the py4j JVM subprocess pipes and buffers for programmatic capturing of its output.
3ece21f to
fa63ba7CompareSparkQA
commented
Oct 29, 2018
Test build #98174 has finished for PR 18339 at commit
|
SparkQA
commented
Oct 29, 2018
Test build #98175 has finished for PR 18339 at commit
|
parente
commented
Oct 30, 2018
@holdenk I rebased the PR and I think it's good to go if you'd like to give it another look. |
parente
commented
Feb 9, 2019
Small bump in case this is still of interest for 3.x. |
holdenk
commented
Feb 11, 2019
The longer this PR has been open the more times I've seen the need for it, my bad on not coming back to this. Jenkins retest this please. |
HyukjinKwon
commented
Feb 11, 2019
For clarification, I am okay. no objection. |
holdenk
commented
Feb 16, 2019
Jenkins retest this please |
holdenk
commented
Feb 16, 2019
@parente if you could merge in master that would trigger a Jenkins run. |
holdenk
commented
Feb 16, 2019
Looks like Jenkins listened, everything passed so will merge to master. |
SparkQA
commented
Feb 16, 2019
Test build #102407 has finished for PR 18339 at commit
|
holdenk
commented
Feb 16, 2019
Merged to master |
## What changes were proposed in this pull request? Allow the caller to customize the py4j JVM subprocess pipes and buffers for programmatic capturing of its output. https://issues.apache.org/jira/browse/SPARK-21094 has more detail about the use case. ## How was this patch tested? Tested by running the pyspark unit tests locally. Closesapache#18339 from parente/feature/SPARK-21094-popen-args. Lead-authored-by: Peter Parente <parente@cs.unc.edu> Co-authored-by: Peter Parente <peter.parente@maxpoint.com> Signed-off-by: Holden Karau <holden@pigscanfly.ca>
What changes were proposed in this pull request?
Allow the caller to customize the py4j JVM subprocess pipes and buffers for programmatic capturing of its output.
https://issues.apache.org/jira/browse/SPARK-21094 has more detail about the use case.
How was this patch tested?
Tested by running the pyspark unit tests locally.