Sunwoo-Shin opened a new issue, #7435:
URL: https://github.com/apache/kyuubi/issues/7435

   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [x] I have searched in the 
[issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Describe the bug
   
   `kyuubi.server.info.provider` set in `kyuubi-defaults.conf` is silently 
ignored — `KyuubiSessionImpl#getInfo` always behaves as if the value were the 
default `ENGINE`; every `TGetInfo` call therefore waits for an engine to launch 
and is forwarded to it.
   
   ### Root cause
   
   `SERVER_INFO_PROVIDER` is marked `.serverOnly`. 
`KyuubiSessionManager#openSession` builds the per-session conf via 
`getConf.getUserDefaults(user)`, which **unsets every `serverOnly` entry** 
before returning. As a result, `sessionConf.get(SERVER_INFO_PROVIDER)` in 
`KyuubiSessionImpl#getInfo` always returns the hard-coded default `"ENGINE"`, 
regardless of `kyuubi-defaults.conf`.
   
   It only appears to work in tests because they pass the value as a 
per-session overlay (`withSessionConf(...)`), which is re-applied after 
`getUserDefaults`.
   
   ### Steps to reproduce
   
   1. Set `kyuubi.server.info.provider=SERVER` in `kyuubi-defaults.conf`.
   2. Connect via JDBC/beeline without overriding it per-session.
   3. A `GetInfo` call still waits for an engine and the call is forwarded to 
it, instead of the server returning its own info directly.
   
   ### Expected vs Actual
   
   - Expected: server-level `SERVER` setting takes effect; `getInfo` returns 
Kyuubi server info immediately.
   - Actual: server-level setting is dropped; `getInfo` always takes the 
`ENGINE` branch.
   
   ### Suggested fix
   
   Read `SERVER_INFO_PROVIDER` from the server-level conf, while still letting 
an explicit per-session override win:
   
   ```scala
   val provider = sessionConf.getOption(SERVER_INFO_PROVIDER.key)
     .getOrElse(sessionManager.getConf.get(SERVER_INFO_PROVIDER))
   ```
   
   Making the entry non-`serverOnly` would also fix it, but would change the 
semantics for all other usages and would let clients flip the mode, so the 
targeted fix is preferred.
   
   ### Affects Version(s)
   
   1.11.1
   
   ### Kyuubi Server Log Output
   
   ```logtalk
   N/A — no error is logged. The bug is a silent fallback to the default value.
   ```
   
   ### Kyuubi Engine Log Output
   
   ```logtalk
   N/A
   ```
   
   ### Kyuubi Server Configurations
   
   ```yaml
   kyuubi.server.info.provider=SERVER
   ```
   
   ### Kyuubi Engine Configurations
   
   ```yaml
   # N/A — engine-side config does not affect this bug.
   ```
   
   ### Additional context
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes. I would be willing to submit a PR with guidance from the Kyuubi 
community to fix.
   - [ ] No. I cannot submit a PR at this time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to