Killing abandoned process on Heroku

后端 未结 4 1561
无人及你
无人及你 2021-02-03 17:12

I killed an IRB prompt in a not-so-graceful manner (started with heroku run irb), and now I\'ve got a zombie process which I can\'t seem to kill:

Pr         


        
相关标签:
4条回答
  • 2021-02-03 17:19

    I noticed a new ps:stop command added to the Heroku command line client a few days ago:
    https://github.com/heroku/heroku/commit/a6d9eb7f314bf2c5f162a508e8d764286fb577bb

    I'm not sure if that change made it into version 2.9.0 but it would be worth a try.

    Update

    This is now in the Heroku Toolbelt. Just run:

    heroku ps:stop <process id from heroku ps>
    

    Example:

    heroku ps:stop run.8729
    
    0 讨论(0)
  • 2021-02-03 17:20

    If anyone else is struggling with killing using something like:

    heroku run ps:stop run.789
    

    Killing by id worked for me:

    heroku ps:kill 61ff0687-eaf4-4299-9c65-f0b22af7ec67
    

    I got the id using the platform api list dynos - https://devcenter.heroku.com/articles/platform-api-reference#dyno-list

    Worked for a detached one-off that was abandoned.

    0 讨论(0)
  • 2021-02-03 17:27

    Thanks James!! I needed to update my Heroku client first, and it worked like a charm.

    $ sudo gem install heroku
    
    $ heroku ps #to view processes
    
    $ heroku stop <process name here>
    
    0 讨论(0)
  • 2021-02-03 17:29

    edit: they've fixed this issue

    Heroku doesn't have a way to kill abandoned run.x processes.

    But it will be killed automatically after 24 hours.

    0 讨论(0)
提交回复
热议问题