@scrypted/server 0.7.61 → 0.7.62

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 @scrypted/server might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/server",
3
- "version": "0.7.61",
3
+ "version": "0.7.62",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@mapbox/node-pre-gyp": "^1.0.10",
@@ -506,9 +506,14 @@ class PluginRemote:
506
506
  print('new fork')
507
507
  pluginFork.worker = multiprocessing.Process(target=plugin_fork, args=(child_conn,), daemon=True)
508
508
  pluginFork.worker.start()
509
+ lastUpdate = time.time()
509
510
 
510
511
  def schedule_exit_check():
511
512
  def exit_check():
513
+ if time.time() - lastUpdate() > 60:
514
+ print('fork worker is unresponsive, terminating')
515
+ pluginFork.worker.kill()
516
+
512
517
  if pluginFork.worker.exitcode != None:
513
518
  pluginFork.worker.join()
514
519
  else:
@@ -523,6 +528,8 @@ class PluginRemote:
523
528
  forkPeer.peerName = 'thread'
524
529
 
525
530
  async def updateStats(stats):
531
+ nonlocal lastUpdate
532
+ lastUpdate = time.time()
526
533
  self.ptimeSum += stats['cpu']['user']
527
534
  self.allMemoryStats[forkPeer] = stats
528
535
  forkPeer.params['updateStats'] = updateStats
@@ -532,8 +539,9 @@ class PluginRemote:
532
539
  await readLoop()
533
540
  except:
534
541
  # traceback.print_exc()
535
- print('fork read loop exited')
542
+ pass
536
543
  finally:
544
+ print('fork read loop exited')
537
545
  self.allMemoryStats.pop(forkPeer)
538
546
  parent_conn.close()
539
547
  rpcTransport.executor.shutdown()