Skip to content

Allow for CTRL-C to break the current operationΒ #126

Closed

Description

@serverchief

In large environments specific API calls take too long to respond because the query was not fine tuned. However - there is no way to terminate the existing running cmk command - as CTRL-C or CTRL-Z would not respond. In this case I launch another cmk instance or terminate the currently running one - but it's rather unnecessary.

Please consider adding a support for "break" to terminate the command running in session.

Activity

  1. yadvr commented on Mar 2, 2023

    @yadvr
    Member

    I couldn't reproduce this with the QA server, http://qa.cloudstack.cloud/, using latest cmk for osx/darwin (arm64). I tried the listEvents and listAlerts APIs. Ctrl+C on API call, terminated the API call and cmk shell. However, it's possible to explore handling a Ctrl+C by a go-routine to terminate an on-going activity.

    Which version of cmk are you using @serverchief

  2. added this to the 6.3.0 milestone on Mar 2, 2023
  3. self-assigned this
    on Mar 2, 2023
  4. borisstoyanov commented on Mar 2, 2023

    @borisstoyanov
    Contributor

    I've tested it out and it terminates the current cmk process (of course not in Cloudstack), it's hanging or being non-responsive in any way:

    (localcloud) 🐱 > deploy virtualmachine templateid=3a679274-b810-11ed-94bb-1e00b200017a serviceofferingid=14820797-8235-414b-9df7-1c94c997c74d zoneid=26510f0c-a5ec-4d7e-aa78-e2fde4178ca0
    ⣯ 😹 polling for async API result ^C
    [root@ref-trl-4577-k-Mr8-boris-stoyanov-mgmt1 ~]#
    
    (localcloud) 🐱 > list events
    ^C
    [root@ref-trl-4577-k-Mr8-boris-stoyanov-mgmt1 ~]#
    
    
    

    The issue is that it kills cmk but not the api call, is this what you're after @serverchief ?

  5. yadvr commented on Apr 26, 2023

    @yadvr
    Member

    Hi @serverchief any advise on how to reproduce this, can you confirm if you face this while using the latest cmk? cc @borisstoyanov @nvazquez

  6. modified the milestones: 6.3.0, 6.4.0 on Apr 28, 2023
  7. yadvr commented on Feb 9, 2024

    @yadvr
    Member

    Hi @serverchief I've added some changes (d1599ea) to allow breaking an long-running async job polling, for example:

    (homecloud) 🐡 > deploy virtualmachine serviceofferingid=2dfe5044-bd0f-44b4-9090-29bda79af1a5 templateid=08d5308d-d571-4568-ba21-fde17053c2f9 zoneid=323a3a13-7758-4042-98fc-e165da1b139c
    ⣟ 😺 polling for async API result
    πŸ™ˆ Error: API job query interrupted
    

    This only works to break async APIs such as deploy VMs. Does this address your issue?

  8. yadvr commented on Feb 9, 2024

    @yadvr
    Member

    I've come up with a fix, which allows a current on-going http request to cancel and allow quick recovery to the prompt. I've tested both long-running list APIs and async APIs such as deploy VM command. This needs testing so reopening this.

    Could you help test this @serverchief ? cc @borisstoyanov @mlsorensen

  9. reopened this on Feb 9, 2024
  10. yadvr commented on Mar 21, 2024

    @yadvr
    Member

    Closing this, tested myself. Pl re-open if there are any issues.

  11. added a commit that references this issue on Jul 31, 2025
    fedf258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions