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

Stuck When used #23

Open
flaming-archer opened this issue Nov 16, 2021 · 7 comments
Open

Stuck When used #23

flaming-archer opened this issue Nov 16, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@flaming-archer
Copy link

I like polysh very much.
But recently I found polysh is easy to stuck.
The cpu is 100%
When i ctrl + c, then display
suTraceback (most recent call last):
File "/xxxxx/polysh/run.py", line 22, in
run()
File "/xxxxx/polysh/main.py", line 277, in run
loop(args.interactive)
File "/xxxxx/polysh/main.py", line 169, in loop
console_output(b'')
File "/xxxxx/polysh/console.py", line 47, in console_output
the_stdin_thread.no_raw_input()
File "/xxxxx/polysh/stdin.py", line 266, in no_raw_input
interrupt_stdin_thread()
File "/xxxxx/polysh/polysh/stdin.py", line 191, in interrupt_stdin_thread
assert not the_stdin_thread.interrupt_asked # Sanity check
AssertionError
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/xxxxx/polysh/main.py", line 219, in
atexit.register(lambda: termios.tcsetattr(fd, termios.TCSADRAIN, old))
termios.error: (25, 'Inappropriate ioctl for device')

@kofrezo kofrezo self-assigned this Nov 16, 2021
@kofrezo kofrezo added the bug Something isn't working label Nov 16, 2021
@kofrezo
Copy link
Contributor

kofrezo commented Nov 16, 2021

Hi @flaming-archer,

Glad to here you like polysh.

Do you have steps to reproduce this issue ?

I tried connecting to a few hundreds hosts and ran a few commands and had no luck seeing it burn CPU and getting stuck.

Information about your environment like Python version and OS could be helpful too.

@HerrSpace
Copy link
Contributor

Terminal emulator and version would also be interesting.

@flaming-archer
Copy link
Author

Python 3.8.10
MacBook Pro (16-inch, 2019) macOS Big sur version 11.6 20G165
Iterm2 Build 3.4.9
Steps:
python3 /xxxx/run.py host1 host2 ...
then do some command like ls cat ..
then stuck.

I doubt whether ssh stable should stuck. For example, when ssh suddenly lost connection or connect need too much time.

@kofrezo
Copy link
Contributor

kofrezo commented Nov 18, 2021

Hey @flaming-archer,

I am able to reproduce as similar behaviour on Mac OS. It seems not to happen on my daily Linux OS. I'll try to debug it on my private Mac when I have some time.

@HerrSpace
Copy link
Contributor

FWIF I think there were always issues with polysh on macos. One issue was that apples patched ssh agent was slow and would sometimes randomly fail when connecting to too many hosts at once. CC @Woellchen who maybe remembers more as he actually used this at work.

@shuosiw
Copy link

shuosiw commented Apr 18, 2022

hi, @kofrezo @HerrSpace . I have the some problem in wsl( with ubuntu)

polysh --hosts-file iplist.txt
waiting (10/10)> Traceback (most recent call last):
  File "/usr/local/bin/polysh", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/polysh/main.py", line 300, in main
    run()
  File "/usr/local/lib/python3.6/dist-packages/polysh/main.py", line 276, in run
    loop(args.interactive)
  File "/usr/local/lib/python3.6/dist-packages/polysh/main.py", line 178, in loop
    console_output(b'')
  File "/usr/local/lib/python3.6/dist-packages/polysh/console.py", line 47, in console_output
    the_stdin_thread.no_raw_input()
  File "/usr/local/lib/python3.6/dist-packages/polysh/stdin.py", line 266, in no_raw_input
    interrupt_stdin_thread()
  File "/usr/local/lib/python3.6/dist-packages/polysh/stdin.py", line 196, in interrupt_stdin_thread
    os.kill(pid, signal.SIGWINCH)  # Try harder to wake up raw_input()
ProcessLookupError: [Errno 3] No such process
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/polysh/main.py", line 218, in <lambda>
    atexit.register(lambda: termios.tcsetattr(fd, termios.TCSADRAIN, old))
termios.error: (25, 'Inappropriate ioctl for device')

my environments is:

  • OS: windows 11
  • wsl: Ubuntu 18.04.2 LTS
  • python: 3.6.7

@kofrezo
Copy link
Contributor

kofrezo commented Apr 20, 2022

Hi @shuosiw,

I will try to have another look at it when I have some spare time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants