Skip to content
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

Thrift HTTP FE checks req conf nullable before evaluating proxy user #5204

Closed
wants to merge 1 commit into from

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Aug 27, 2023

Why are the changes needed?

This PR fixes a NPE when client opens session with null configuration using Thrift HTTP protocol

2023-08-28 02:03:56.512 ERROR org.apache.kyuubi.server.KyuubiTHttpFrontendService: Error opening session:
java.lang.NullPointerException: null
        at org.apache.kyuubi.service.TFrontendService.getProxyUser(TFrontendService.scala:130) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.server.KyuubiTHttpFrontendService.getRealUserAndSessionUser(KyuubiTHttpFrontendService.scala:281) ~[kyuubi-server_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.service.TFrontendService.getSessionHandle(TFrontendService.scala:168) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.service.TFrontendService.OpenSession(TFrontendService.scala:190) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1497) ~[hive-service-rpc-3.1.3.jar:3.1.3]
        at org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1482) ~[hive-service-rpc-3.1.3.jar:3.1.3]
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.thrift.server.TServlet.doPost(TServlet.java:83) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.kyuubi.server.http.ThriftHttpServlet.doPost(ThriftHttpServlet.scala:146) ~[kyuubi-server_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

Was this patch authored or co-authored using generative AI tooling?

No

@codecov-commenter
Copy link

Codecov Report

Merging #5204 (1116b5e) into master (3a06cc3) will not change coverage.
The diff coverage is 0.00%.

@@          Coverage Diff           @@
##           master   #5204   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         589     589           
  Lines       33236   33238    +2     
  Branches     4386    4387    +1     
======================================
- Misses      33236   33238    +2     
Files Changed Coverage Δ
...che/kyuubi/server/KyuubiTHttpFrontendService.scala 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pan3793 pan3793 self-assigned this Aug 28, 2023
@pan3793 pan3793 added this to the v1.7.2 milestone Aug 28, 2023
@pan3793 pan3793 closed this in 37f2c98 Aug 28, 2023
pan3793 added a commit that referenced this pull request Aug 28, 2023
…ing proxy user

### _Why are the changes needed?_

This PR fixes a NPE when client opens session with null configuration using Thrift HTTP protocol

```
2023-08-28 02:03:56.512 ERROR org.apache.kyuubi.server.KyuubiTHttpFrontendService: Error opening session:
java.lang.NullPointerException: null
        at org.apache.kyuubi.service.TFrontendService.getProxyUser(TFrontendService.scala:130) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.server.KyuubiTHttpFrontendService.getRealUserAndSessionUser(KyuubiTHttpFrontendService.scala:281) ~[kyuubi-server_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.service.TFrontendService.getSessionHandle(TFrontendService.scala:168) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.kyuubi.service.TFrontendService.OpenSession(TFrontendService.scala:190) ~[kyuubi-common_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1497) ~[hive-service-rpc-3.1.3.jar:3.1.3]
        at org.apache.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1482) ~[hive-service-rpc-3.1.3.jar:3.1.3]
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.thrift.server.TServlet.doPost(TServlet.java:83) ~[libthrift-0.9.3.jar:0.9.3]
        at org.apache.kyuubi.server.http.ThriftHttpServlet.doPost(ThriftHttpServlet.scala:146) ~[kyuubi-server_2.12-1.8.0-SNAPSHOT.jar:1.8.0-SNAPSHOT]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[jakarta.servlet-api-4.0.4.jar:4.0.4]
```

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No

Closes #5204 from pan3793/http-null.

Closes #5204

1116b5e [Cheng Pan] Thrift HTTP FE checks req conf nullable before evaluating proxy user

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 37f2c98)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793
Copy link
Member Author

pan3793 commented Aug 28, 2023

Thanks, merged to master/1.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants