bryanpkc/corkscrew

Corkscrew eats 100% of CPU

Opened this issue · 4 comments

Hello,
thank you for your time for Corkscrew development. Very useful tool.
Seems, that I found a small bug.
Corkscrew eats 100% of CPU when ssh server unavailable by network problems. There is happens when I receive similar error message from proxy server:
Gateway Timeout
ssh_exchange_identification: Connection closed by remote host

Seems that corkscrew trys reconnecting without any pause, causing proxy flood.

$ corkscrew --help
corkscrew 2.0 (agroman@agroman.net)
From official repositoies of Ubuntu 18.04

I've checked the least version from master. Problem the same.

same problem

top - 13:14:01 up 13 days, 20:19,  4 users,  load average: 5.15, 4.71, 4.14
Tasks: 482 total,   5 running, 377 sleeping,   0 stopped,   0 zombie
%Cpu(s): 24.4 us, 31.7 sy,  0.0 ni, 41.4 id,  0.1 wa,  0.0 hi,  2.4 si,  0.0 st
KiB Mem : 16081432 total,  1307256 free, 12854056 used,  1920120 buff/cache
KiB Swap: 15624188 total, 12304392 free,  3319796 used.  1779992 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                                                                                               
 6044 lizj      20   0    4508    268    204 R 100.0  0.0   1392:33 corkscrew                                                                                                                                                                                                             
18973 lizj      20   0    4508     20      0 R 100.0  0.0  10033:33 corkscrew                                                                                                                                                                                                             
 4309 lizj      20   0    4508    212    148 R 100.0  0.0   1428:33 corkscrew             

Check PR!14. They did mention your problem, so it might already be fixed there.

Occasionally, Corkscrew uses 100% of my CPU capacity. Can someone help resolve this issue as it's causing significant damage to my PC?