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

Add query timeout mechanism #1395

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Add query timeout mechanism #1395

merged 1 commit into from
Mar 23, 2023

Conversation

acquamarin
Copy link
Collaborator

@acquamarin acquamarin commented Mar 21, 2023

1. Query timeout mechanism:

a. The system will abort queries which execute longer than the time_out limit.
b. The default timeout value is 120000MS(2 minutes) and query timeout is disabled by default.

2. Added two APIs to connection:

a. void setQueryTimeOut(uint64_t timeoutInMS): sets the query timeout value of the current connection.
b. void setQueryTimeOutEnabled(bool isEnabled): enables/disabled the query timeout of the current connection.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (956473d) 92.79% compared to head (097448b) 92.80%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1395   +/-   ##
=======================================
  Coverage   92.79%   92.80%           
=======================================
  Files         641      642    +1     
  Lines       22043    22066   +23     
=======================================
+ Hits        20455    20478   +23     
  Misses       1588     1588           
Impacted Files Coverage Δ
src/include/common/task_system/task_scheduler.h 100.00% <ø> (ø)
src/include/main/connection.h 100.00% <ø> (ø)
src/include/main/prepared_statement.h 100.00% <ø> (ø)
src/common/task_system/task_scheduler.cpp 89.15% <100.00%> (+0.84%) ⬆️
src/include/common/exception.h 86.36% <100.00%> (ø)
src/include/common/timer.h 90.90% <100.00%> (+3.40%) ⬆️
src/include/main/client_context.h 100.00% <100.00%> (ø)
src/main/client_context.cpp 100.00% <100.00%> (ø)
src/main/connection.cpp 82.30% <100.00%> (+0.27%) ⬆️
src/processor/processor.cpp 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

test/main/connection_test.cpp Outdated Show resolved Hide resolved
src/include/common/exception.h Outdated Show resolved Hide resolved
src/common/task_system/task_scheduler.cpp Outdated Show resolved Hide resolved
src/common/task_system/task_scheduler.cpp Outdated Show resolved Hide resolved
src/common/task_system/task_scheduler.cpp Outdated Show resolved Hide resolved
src/include/main/client_context.h Outdated Show resolved Hide resolved
src/include/main/client_context.h Outdated Show resolved Hide resolved
src/include/main/client_context.h Outdated Show resolved Hide resolved
src/include/main/client_context.h Show resolved Hide resolved
Copy link
Contributor

@ray6080 ray6080 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update your pr description (timeout is not applicable to Copy). And I want to take another look, meanwhile we can discuss how to address the problem of propagate the exception in one worker thread to others in the same task.

src/common/task_system/task_scheduler.cpp Outdated Show resolved Hide resolved
src/include/main/client_context.h Outdated Show resolved Hide resolved
@acquamarin acquamarin force-pushed the timeout branch 2 times, most recently from 37c8a49 to c1024ad Compare March 23, 2023 03:04
src/include/common/timer.h Outdated Show resolved Hide resolved
src/include/main/connection.h Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants