Skip to content

Commit 33738d0

Browse files
committed
chore: temp diagnostic for #4953 (capture reading-length stack + client network)
Signed-off-by: Fantomasa <ivailoinfo@gmail.com>
1 parent 34d4a1c commit 33738d0

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

src/commands/account.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,18 @@ export class AccountCommand extends BaseCommand {
424424
{type: 'all', skipNodeAlias: nodeAlias},
425425
);
426426

427+
// [4953-DEBUG]
428+
this.logger.showUser(
429+
`[4953-DEBUG] update-admin-key node=${nodeAlias} network=${JSON.stringify(
430+
Object.fromEntries(
431+
Object.entries(nodeClient.network).map(([endpoint, accountId]): [string, string] => [
432+
endpoint,
433+
accountId?.toString?.() ?? String(accountId),
434+
]),
435+
),
436+
)}`,
437+
);
438+
427439
try {
428440
let nodeUpdateTx: NodeUpdateTransaction = new NodeUpdateTransaction().setNodeId(
429441
new Long(nodeId),
@@ -456,6 +468,12 @@ export class AccountCommand extends BaseCommand {
456468
{'solo.hedera.com/node-admin-key': 'true'},
457469
);
458470
} catch (error) {
471+
// [4953-DEBUG]
472+
this.logger.showUser(
473+
`[4953-DEBUG] update-admin-key CATCH node=${nodeAlias} ` +
474+
`msg=${error instanceof Error ? error.message : String(error)} ` +
475+
`stack=${error instanceof Error ? error.stack : 'n/a'}`,
476+
);
459477
throw new SoloErrors.component.nodeAccessConfigFailed(error);
460478
}
461479
}

src/core/account-manager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,14 @@ export class AccountManager {
445445

446446
return object;
447447
} catch (error) {
448+
// [4953-DEBUG]
449+
this.logger.showUser(
450+
`[4953-DEBUG] configureNodeAccess CATCH node=${networkNodeService?.nodeAlias} ` +
451+
`accountId=${networkNodeService?.accountId} haProxyPod=${networkNodeService?.haProxyPodName} ` +
452+
`haProxyGrpcPort=${networkNodeService?.haProxyGrpcPort} localPort=${localPort} ` +
453+
`msg=${error instanceof Error ? error.message : String(error)} ` +
454+
`stack=${error instanceof Error ? error.stack : 'n/a'}`,
455+
);
448456
throw new SoloErrors.component.nodeAccessConfigFailed(error);
449457
}
450458
}

src/integration/kube/k8-client/resources/pod/k8-client-pod.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,6 @@ export class K8ClientPod implements Pod {
336336
return matchedProcesses;
337337
}
338338

339-
// Best-effort: signal the process group led by pid (detached forwards are group leaders); ignore if not a leader.
340-
private static killProcessGroup(pid: number, signal: NodeJS.Signals): void {
341-
try {
342-
process.kill(-pid, signal);
343-
} catch {
344-
// not a group leader (or already exited); the direct process.kill(pid) call handles it
345-
}
346-
}
347-
348339
public async stopPortForward(port: number): Promise<void> {
349340
if (!port) {
350341
return;
@@ -371,8 +362,6 @@ export class K8ClientPod implements Pod {
371362
// Extract PIDs and kill the processes
372363
for (const pid of matchedProcesses.map((p: ProcessInfo): number => p.pid)) {
373364
try {
374-
// Signal the whole detached process group so no orphaned kubectl child keeps the local port. #4953
375-
K8ClientPod.killProcessGroup(pid, 'SIGTERM');
376365
process.kill(pid, 'SIGTERM');
377366
this.logger.debug(`Successfully sent SIGTERM to PID: ${pid}`);
378367

@@ -385,7 +374,6 @@ export class K8ClientPod implements Pod {
385374
this.logger.debug(
386375
`Process with PID ${pid} is still running after SIGTERM, attempting to kill with SIGKILL`,
387376
);
388-
K8ClientPod.killProcessGroup(pid, 'SIGKILL');
389377
process.kill(pid, 'SIGKILL');
390378
}
391379
} catch (killError) {

0 commit comments

Comments
 (0)