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

PS-9193: JS Routines: killability/max_statement_time support. #5540

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

dlenev
Copy link
Contributor

@dlenev dlenev commented Jan 20, 2025

Improved handling of KILL and MAX_EXECUTION_TIME timeouts in connections running JS code.

JS language component now gets notified when connection (or statement)
executing JS code gets killed (due to KILL statement or due to reaching
MAX_EXECUTION_TIME timeout). The component calls V8 method aborting
execution of JS code, allowing to terminate connection/statement without
delays.

components/js_lang/js_lang_common.h Outdated Show resolved Hide resolved
components/js_lang/js_lang_core.cc Outdated Show resolved Hide resolved
components/js_lang/js_lang_core.cc Outdated Show resolved Hide resolved
components/js_lang/js_lang_core.h Outdated Show resolved Hide resolved
sql/server_component/mysql_thd_kill_notification_imp.h Outdated Show resolved Hide resolved
sql/sql_class.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@percona-ysorokin percona-ysorokin left a comment

Choose a reason for hiding this comment

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

LGTM

https://perconadev.atlassian.net/browse/PS-9193

Improved handling of KILL and MAX_EXECUTION_TIME timeouts in connections
running JS code.

Special KILL handler in JS language component is now invoked when connection
(or statement) executing JS code gets killed (due to KILL statement or due to
reaching MAX_EXECUTION_TIME timeout). The handler calls V8 method aborting
execution of JS code, allowing to terminate connection/statement without
delays.

To implement this a new service was added to SQL core which allows components
to install/remove such KILL handlers for connections.
@dlenev dlenev marked this pull request as ready for review January 21, 2025 15:02
@dlenev dlenev merged commit b8129b0 into percona:js-lang Jan 22, 2025
21 of 22 checks passed
@dlenev dlenev deleted the js-lang-9193 branch January 22, 2025 10:33
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.

2 participants