pmxtjs 2.34.1 → 2.34.3

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.
@@ -349,10 +349,23 @@ export class ServerManager {
349
349
  if (info && info.pid) {
350
350
  try {
351
351
  process.kill(info.pid, 'SIGTERM');
352
- // Brief wait
353
352
  await new Promise(resolve => setTimeout(resolve, 500));
354
353
  } catch {
355
- // Ignore
354
+ // Process already dead — fall through to lock cleanup
355
+ }
356
+
357
+ // Verify the process is actually dead; escalate to SIGKILL if not
358
+ try {
359
+ process.kill(info.pid, 0); // throws if dead
360
+ // Still alive — force kill
361
+ try {
362
+ process.kill(info.pid, 'SIGKILL');
363
+ await new Promise(resolve => setTimeout(resolve, 200));
364
+ } catch {
365
+ // Ignore — SIGKILL may race with natural exit
366
+ }
367
+ } catch {
368
+ // Process is dead — good
356
369
  }
357
370
  }
358
371
  // Remove lock file (best effort)