-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-43879][CONNECT] Decouple handle command and send response on server side #41379
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
Conversation
|
In case of multi |
Yeah! This is an issue. I will improve it. |
|
@zhengruifeng Currently, except for |
|
cc @grundprinzip @hvanhovell what do you think of this PR? |
|
Unfortunately, I think this might not be the best possible approach. Any command has the ability to send any response "right now" and expects that it will be returned. The client can change their behavior based on this and we should not simply buffer all responses. In addition, if I understand correctly, buffering the responses is not great for memory consumption reasons. In the asynchronous query processing case, we want to immediately return a message for example that returns a query ID for the client to re-attache to. |
I agree your opinion. In fact, all the has implemented command will not occur the issues you commented. So, do we really have the scene you comment above ? |
|
even if there is no other commands returning multiple response, I don't feel strongly about the idea of introducing such a limitation. I also think we should send them asap. |
|
👎 on this PR in the current state as the protocol is using a streaming response. That today this is not directly used is not a good enough answer. Users can stream responses back using custom commands from the extension registry. |
What changes were proposed in this pull request?
SparkConnectStreamHandlertreats the proto requests from connect client and send the responses back to connect client.SparkConnectStreamHandlerholds a componentStreamObserverto send responses.So I think we should keep the
StreamObservercould be accessed only withSparkConnectStreamHandler.This PR want decouple the process handle commands and the other process send responses on server side.
After this PR, we can remove
MockObserverwhich seems is not useful.Why are the changes needed?
Decouple handle command and send response on server side.
Does this PR introduce any user-facing change?
'No'.
Just update the inner implementation.
How was this patch tested?
Exists test cases.