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

esrally CLI should always return 130 when cancelled #1222

Closed
DJRickyB opened this issue Mar 26, 2021 · 3 comments · Fixed by #1285
Closed

esrally CLI should always return 130 when cancelled #1222

DJRickyB opened this issue Mar 26, 2021 · 3 comments · Fixed by #1285
Assignees
Labels
good first issue Small, contained changes that are good for newcomers

Comments

@DJRickyB
Copy link
Contributor

DJRickyB commented Mar 26, 2021

Currently, if the actor system is initialized and tasks have started, a Ctrl+C sent to the CLI causes an orderly shutdown and logs a SUCCESS message, returning return code 0. For the sake of shell scripts or other invocations with traps it would be nice if these were seen as a reason to tear down the outer workflow.

Current behavior (note tasks delete-index and create-index here are running. If tasks are running, send Ctrl+C):

% esrally race --track=geonames --test-mode

    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/

[INFO] Preparing for race ...
[INFO] Racing on track [geonames], challenge [append-no-conflicts] and car ['defaults'] with version [8.0.0-SNAPSHOT].
Running delete-index                                                           [100% done]
Running create-index                                                           [  0% done]^C
--------------------------------
[INFO] SUCCESS (took 15 seconds)
--------------------------------

 % echo $?
   0

desired behavior (for instance):

% esrally race --track=geonames --test-mode

    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/

[INFO] Preparing for race ...
[INFO] Racing on track [geonames], challenge [append-no-conflicts] and car ['defaults'] with version [8.0.0-SNAPSHOT].
Running delete-index                                                           [100% done]
Running create-index                                                           [  0% done]^C
--------------------------------
[INFO] ABORTED (took 15 seconds)
--------------------------------

 % echo $?
   130

Note that SUCCESS is now ABORTED, and the return code of the command is 130 instead of 0. Bonus points if after Ctrl+C is sent some sort of acknowledgement is printed to stderr such as:
Rally has detected KeyboardInterrupt. Shutting down...

@DJRickyB DJRickyB added the good first issue Small, contained changes that are good for newcomers label Mar 26, 2021
@madlad33
Copy link

madlad33 commented May 6, 2021

Hello, can I work on this issue?

@DJRickyB
Copy link
Contributor Author

DJRickyB commented May 6, 2021

@madlad33 Sure! Please submit a PR when you are ready 😄

@DJRickyB
Copy link
Contributor Author

DJRickyB commented May 6, 2021

Also, in case you haven't seen it before, this project is governed by Elastic's Contributor License Agreement (CLA):
https://www.elastic.co/contributor-agreement

You must agree and sign there before we can merge in any contributions. Thanks for looking at this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Small, contained changes that are good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants