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
[TASK][EASY] Statements get blocked even with timeouts of connection, socket and query already set #5392
Comments
It's suspicious that the loop inside
In step one, it uses a KyuubiSessionImpl:
KyuubiSyncThriftClient:
With no socket timeout set, it may block the timeout state checks and therefore the statement is not able to do the step 2 and jammed at step 1. |
Try setting |
The engine probe is a side-way approach for engine lifecycle. May I create a PR to change the socket timeout from 0 to defined value falling back to query timeout ? |
timeout 0 with additional probe is by design, the thrift client lifecycle does not match the statement |
Can you provide engine logs? Query timeout is triggered by the engine side. |
Sorry, the engine log is not available. |
OK. Is there anything we could do on the server side for a timeout guarantee? |
I think the case may not be due to this. If client socket is blocked, the operation should not receive TIMEDOUT_STATE. |
Doubtfully have TIMEDOUT_STATE finally, the driver could be busy GC and not responding correctly. And maybe when it is back to normal, it sends the response. |
I see not timeout limits on |
Full GC that lasts an hour seems impossible, if that happens the yarn will kill engine too. |
I think we can also start queryTimeout monitor in the server. |
Socket timeout is about maximum time to wait for the response only. A limited value is more close to the guarantee. |
SGTM. Once the elapsed duration of the statement is greater tahn the query timeout , the statement should be marked as TIMED_OUT status. |
@bowenliang123 there is a chance that the fetch result may block for a long time, for example, when incremental collect is enabled, once the first partition of the result is available, the operation state will be marked as FINISHED, the subsequential partitions will be calculated lazily, which may cause the fetch result blocks for a long time. And, query timeout should be a concept of operation scope, but the thrift client is session scope |
…tement ### _Why are the changes needed?_ As reported in #5392, currently the server is unable to guarantee that the statement timed-out when the engine may have no proper response for the server's request therefore the query timeout does not work. Introduce a server-side statement query timeout monitor, to ensure the time-out query statements are set to TIMEOUT state and help the JDBC client get out of the blocked status. ### _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 #5398 from bowenliang123/stmt-timeout. Closes #5392 f5733b3 [Bowen Liang] use addTimeoutMonitor for server-side query timeout checks Authored-by: Bowen Liang <liangbowen@gf.com.cn> Signed-off-by: liangbowen <liangbowen@gf.com.cn> (cherry picked from commit bdc28ac) Signed-off-by: liangbowen <liangbowen@gf.com.cn>
The server-side timeout monitor for |
Code of Conduct
Search before asking
Describe the bug
With the follow timeout set, the statement gets block and no proper response or connection closing.
Connection and socket timeouts are set via JDBC URL:
jdbc:kyuubi://kyuubi_server_ip:port/;retries=3;connectTimeout=300000;socketTimeout=1800000
Query Timeout is set via JDBC statement
statement.setTimeout()
.Connection Timeout: 30000 ms (or 30s)
Socket Timeout: 1800000ms (or 30min)
Query Timeout: 60*60 sec (or 1hr)
After waiting for ~ 3hr, the statement finally gets TIMEDOUT_STATE and closes the session.
Affects Version(s)
1.7.1 / master
Kyuubi Server Log Output
The insert statement was submitted at
06:22:24
.At first, the JDBC statement logs output correctly with repeated
RUNNING_STATE
.At
06:29:24
, the output get blocked, until over 2 hours later at08:35:41
.Finally, at
09:16:03
, with SQLTimeoutException thrown and failed the query.Kyuubi Engine Log Output
No response
Kyuubi Server Configurations
No response
Kyuubi Engine Configurations
No response
Additional context
No response
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: