plum-e2e 2.5.11 → 2.5.12

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.
Files changed (2) hide show
  1. package/bin/plum.js +14 -10
  2. package/package.json +1 -1
package/bin/plum.js CHANGED
@@ -513,7 +513,6 @@ async function serverUpdate() {
513
513
  // `plum update` happens to be run from.
514
514
  const { getInstalls } = globalRegistryLib();
515
515
  const { loadNodeConfig } = nodeRegisterLib();
516
- const { loadRegistry, isAlive } = runnerProcessLib();
517
516
 
518
517
  let restartedAnything = false;
519
518
 
@@ -533,15 +532,16 @@ async function serverUpdate() {
533
532
  }
534
533
  }
535
534
 
536
- const registry = loadRegistry();
537
535
  for (const dir of getInstalls('node')) {
538
536
  const nodeCfg = loadNodeConfig(dir);
539
- const running = !!(
540
- nodeCfg.id &&
541
- registry[String(nodeCfg.id)]?.pid &&
542
- isAlive(registry[String(nodeCfg.id)].pid)
543
- );
544
- if (!running) continue;
537
+ if (!nodeCfg.id) continue;
538
+ // Always attempt the restart rather than gating on the local PID
539
+ // registry: that registry goes stale (manager restarts, pre-existing
540
+ // installs from before this tracking existed, etc.), and skipping the
541
+ // restart in those cases silently leaves the OLD node process running
542
+ // mismatched code — it still answers /api/ping so it looks "online"
543
+ // while actually being unreachable. `plum node restart` itself falls
544
+ // back to port-based PID discovery, so it's safe to call unconditionally.
545
545
  clack.log.step(`Restarting node runner at ${dir}…`);
546
546
  try {
547
547
  execSync('plum node restart', { stdio: 'inherit', cwd: dir });
@@ -757,7 +757,11 @@ async function nodeRestart() {
757
757
  return;
758
758
  }
759
759
 
760
- const stopped = stopNode(String(cfg.id));
760
+ // Passing the port lets stopNode fall back to port-based PID discovery when
761
+ // the local registry entry is missing or stale (e.g. after `plum update`
762
+ // reinstalls in a fresh process) — otherwise a still-running old process is
763
+ // left bound to the port while a new one starts up alongside it.
764
+ const stopped = stopNode(String(cfg.id), Number(cfg.port));
761
765
  if (stopped) {
762
766
  clack.log.success(`Stopped runner "${cfg.name ?? cfg.id}".`);
763
767
  } else {
@@ -1179,7 +1183,7 @@ switch (command) {
1179
1183
  const cfg = loadNodeConfig(process.cwd());
1180
1184
 
1181
1185
  if (cfg.id) {
1182
- const stopped = stopNode(String(cfg.id));
1186
+ const stopped = stopNode(String(cfg.id), Number(cfg.port));
1183
1187
  if (stopped) {
1184
1188
  clack.log.success(`Stopped runner "${cfg.name ?? cfg.id}".`);
1185
1189
  } else if (cfg.pid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "2.5.11",
3
+ "version": "2.5.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"