STOP NOT working in windows while use remote interpreter!

pycharm version: PyCharm 2022.2 (Professional Edition)

platform: windows10

I use the remote interpreter in linux, when i click the stop button,in windows,the process is stop,but in linux,the process is still alive!

0
18 comments

Could you please provide more specifics? You are using the SSH interpreter from Windows, having Linux as your target machine, right? Does the issue reproduce if you run a simple loop like the following:

from time import sleep


def main():
for i in range(99):
print(f'tick {i}')
sleep(.5)


if __name__ == '__main__':
main()
0

1. When I create a flask service,STOP in windows,and linux still alive. I also realized that stopping the process now would take more time, about 10 seconds.

step1: start the flask service, and then stop the service by click the STOP button, SUCCESS

step2. in linux,the process also still alive

step3. start the flask service again, the port is used.

0

another example

step1: run below code

import datetime
import time

print(1, datetime.datetime.now())
time.sleep(2000)
print(2, datetime.datetime.now())

step2. in linux, it can search this process, and the timing is matched.

step3. click STOP button,**it takes almost 10 seconds to stop**.

step4. search this process in linux again, it also still alive

0

And the flask service can be called normally.

0

Thank you. Not reproducible for me, unfortunately -- the Flask service is stopped completely when hitting the stop button in PyCharm. Can restart it successfully afterwards.

Could you please check if the issue is reproduced with the default IDE settings?

To restore default settings, you can use **File | Manage IDE settings | Restore Default Settings...**. Your current settings will be backed up, so you can revert to them later if needed (to do this, just import settings from the backed up folder).

0

1. I uninstall the pycharm,and remove the install folder,and rm the JetBrains in `C:\Users\XXX\AppData\Local\JetBrains` and the folder `C:\Users\XXX\AppData\Roaming\JetBrains` in windows. I also remove the folder in linux named `/home/lucas/.pycharm_helpers`. I also clearing the registry and restart the windows

2. Reinstall the pycharm(Build #PY-222.3345.131, built on July 28, 2022), this error also reproduced !!!!!!!!!!!

0

When I install Build #PY-221.6008.17, built on July 21, 2022

EVERYTHING IS WELL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0

Actually, I'm experience the same on both of my Windows machines. Remote stopping works very weird, up to half a minute, GPU memory is not freed, etc. Problem seems lie in multi-process PyCharm helpers under Ubuntu 16.04 and Python 3.9.

1

Heh, it suddenly can't stop scripts that are multi-process, i.e. spawning the processes through ProcessPoolExecutor. Stop button hangs for a moment and then pretends nothing happens. This is a new regression (latest PyCharm builds).

Original processes are stay there indefinitely (or until complete). Consider the CPU load after IDE "stopped":

0

Well, further investigating I'm now thinking the Ctrl-C sequence isn't being sent to the process in question and that is the root of the issue.

Environment is Ubuntu 16.04 + Python 3.9.

0

A similar issue is tracked under https://youtrack.jetbrains.com/issue/PY-55448/Stop-script-on-remote-interpreter-hangs and the linked issues. Please follow and vote.

0

Max Dyachenko

Indeed, instead of Ctrl-C (KeyboardInterrupt, SIGINT, signal 2), 2022.2 now uses SIGTERM (signal 15). The latter also asks the process to terminal gracefully so it shouldn't be the issue. Are you able to stop the remote process manually using SIGTERM, e.g. by sending `kill -15 <pid>`?

0

Sure, kill command kills everything, no problem - actually I'm now forced to do that through `htop` to stop the pycharm helper process (including the subprocesses) which is a so great inconvenience I'm considering the IDE switch.

But I believe 2022.2 uses something else than SIGTERM. I'm pretty sure versions <2022.2 used SIGTERM because the processes where killed almost instantly (including the children) . I don't think 2022.2 can hang on simple SIGTERM execution.

0

Actually, I believe <2022.2 used SIGINT, followed by SIGTERM in about 5 seconds or something (if the process persists).

0

Sorry, I'm out of ideas for now -- couldn't reproduce the issue on my side. Please follow https://youtrack.jetbrains.com/issue/PY-55448/Stop-script-on-remote-interpreter-hangs for further updates, hopefully we'll be able to narrow down the issue soon.

0

Could you please make sure you are not a root when reproducing this?

0

Recently updated pycharm and I'm having the same issue.

0

I've also updated my pycharm recently and I'm having the same issue (with multi-process). Was anyone able to resolve it? 

0

Please sign in to leave a comment.