Skip to content

feat(frontend): support kill command - #13434

Merged
chenzl25 merged 3 commits into
mainfrom
dylan/support_kill
Nov 15, 2023
Merged

chenzl25 merged 3 commits into
mainfrom
dylan/support_kill

Conversation

@chenzl25

@chenzl25 chenzl25 commented Nov 15, 2023 •

Copy link
Copy Markdown
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Example:

dev=> show processlist;
 Id | User |      Host       | Database |  Time   |                            Info
----+------+-----------------+----------+---------+------------------------------------------------------------
 0  | root | 127.0.0.1:60858 | dev      | 35363ms | insert into t select i from generate_series(1, 1000000) i;
 1  | root | 127.0.0.1:60935 | dev      | 0ms     | show processlist;
 2  | root | 127.0.0.1:60941 | dev      | 4304ms  | create materialized view mv2 as select * from t;
(3 rows)

dev=> kill 2;
KILL

dev=> kill 0;
KILL

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

  • Support kill command to kill process.

@chenzl25 chenzl25 added the user-facing-changes Contains changes that are visible to users label Nov 15, 2023
@github-actions github-actions Bot added the type/feature Type: New feature. label Nov 15, 2023
@chenzl25
chenzl25 requested review from fuyufjh, wangrunji0408 and yezizp2012 and removed request for fuyufjh and yezizp2012 November 15, 2023 06:03

@yezizp2012 yezizp2012 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented Nov 15, 2023 •

Copy link
Copy Markdown

Codecov Report

Attention: 45 lines in your changes are missing coverage. Please review.

Comparison is base (094a071) 67.62% compared to head (2727518) 67.66%.
Report is 2 commits behind head on main.

Files Patch % Lines
src/frontend/src/session.rs 0.00% 18 Missing ⚠️
src/frontend/src/handler/kill_process.rs 0.00% 16 Missing ⚠️
src/sqlparser/src/parser.rs 0.00% 5 Missing ⚠️
src/sqlparser/src/ast/mod.rs 0.00% 3 Missing ⚠️
src/frontend/src/handler/show.rs 0.00% 2 Missing ⚠️
src/frontend/src/handler/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13434      +/-   ##
==========================================
+ Coverage   67.62%   67.66%   +0.04%     
==========================================
  Files        1527     1528       +1     
  Lines      260464   260500      +36     
==========================================
+ Hits       176132   176278     +146     
+ Misses      84332    84222     -110     
Flag Coverage Δ
rust 67.66% <0.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wangrunji0408

wangrunji0408 commented Nov 15, 2023 •

Copy link
Copy Markdown
Contributor

tip: we can migrate this to the pg_terminate_backend function after the #[funcion] macro is available for system functions. #13142

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

Labels

type/feature Type: New feature. user-facing-changes Contains changes that are visible to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants