multiSSH3 5.41__py3-none-any.whl → 5.42__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of multiSSH3 might be problematic. Click here for more details.

@@ -0,0 +1,6 @@
1
+ multiSSH3.py,sha256=Xs05pxUY2WXSF-o98K87wKbIwNxtkKZlDwrthtzQf1Q,138824
2
+ multiSSH3-5.42.dist-info/METADATA,sha256=xtXbj1Q5ezo_UxPdqOp9b2vcBnkywdQY1gHeTwAARYQ,18001
3
+ multiSSH3-5.42.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ multiSSH3-5.42.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
+ multiSSH3-5.42.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
+ multiSSH3-5.42.dist-info/RECORD,,
multiSSH3.py CHANGED
@@ -45,7 +45,7 @@ except AttributeError:
45
45
  # If neither is available, use a dummy decorator
46
46
  def cache_decorator(func):
47
47
  return func
48
- version = '5.41'
48
+ version = '5.42'
49
49
  VERSION = version
50
50
 
51
51
  CONFIG_FILE = '/etc/multiSSH3.config.json'
@@ -1156,7 +1156,7 @@ def __handle_writing_stream(stream,stop_event,host):
1156
1156
  sentInput += 1
1157
1157
  host.lastUpdateTime = time.time()
1158
1158
  else:
1159
- time.sleep(0.1)
1159
+ time.sleep(0.01) # sleep for 10ms
1160
1160
  if sentInput < len(__keyPressesIn) - 1 :
1161
1161
  eprint(f"Warning: {len(__keyPressesIn)-sentInput} key presses are not sent before the process is terminated!")
1162
1162
  # # send the last line
@@ -1364,6 +1364,7 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
1364
1364
  # Monitor the subprocess and terminate it after the timeout
1365
1365
  host.lastUpdateTime = time.time()
1366
1366
  timeoutLineAppended = False
1367
+ sleep_interval = 1.0e-8 # 10 nanoseconds
1367
1368
  while proc.poll() is None: # while the process is still running
1368
1369
  if timeout > 0:
1369
1370
  if time.time() - host.lastUpdateTime > timeout:
@@ -1371,7 +1372,6 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
1371
1372
  host.output.append('Timeout!')
1372
1373
  proc.send_signal(signal.SIGINT)
1373
1374
  time.sleep(0.1)
1374
-
1375
1375
  proc.terminate()
1376
1376
  break
1377
1377
  elif time.time() - host.lastUpdateTime > max(1, timeout // 2):
@@ -1395,7 +1395,11 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
1395
1395
  time.sleep(0.1)
1396
1396
  proc.terminate()
1397
1397
  break
1398
- time.sleep(0.1) # avoid busy-waiting
1398
+ time.sleep(sleep_interval) # avoid busy-waiting
1399
+ if sleep_interval < 0.001:
1400
+ sleep_interval *= 2
1401
+ elif sleep_interval < 0.01:
1402
+ sleep_interval *= 1.1
1399
1403
  stdin_stop_event.set()
1400
1404
  # Wait for output processing to complete
1401
1405
  stdout_thread.join(timeout=1)
@@ -2258,7 +2262,7 @@ def processRunOnHosts(timeout, password, max_connections, hosts, returnUnfinishe
2258
2262
  if not returnUnfinished:
2259
2263
  # wait until all hosts have a return code
2260
2264
  while any([host.returncode is None for host in hosts]):
2261
- time.sleep(0.1)
2265
+ time.sleep(0.01)
2262
2266
  for thread in threads:
2263
2267
  thread.join(timeout=3)
2264
2268
  # update the unavailable hosts and global unavailable hosts