Skip to content

Commit

Permalink
report incarnation on PROBING_REPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Oct 3, 2024
1 parent 70616f6 commit 54d50ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Jerboa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ export class Jerboa {
const nodes = this.getOutgoingLinks();
if (nodes.length === 0) {
if (process.env.PROBING_REPORT) {
console.log(`finished (${probeId})`, [], [this.name, nackSender].concat(debugInfo.backtracked));
console.log(`finished (${probeId}:${incarnation})`, [], [this.name, nackSender].concat(debugInfo.backtracked));
}
} else {
if (process.env.PROBING_REPORT) {
console.log(`backtracked (${probeId})`, [ this.name ], [nackSender].concat(debugInfo.backtracked));
console.log(`backtracked (${probeId}:${incarnation})`, [ this.name ], [nackSender].concat(debugInfo.backtracked));
}
const newStep = randomStringFromArray(nodes);
// console.log(`${this.name} sends probe message to ${newStep} for probeId ${probeId} after receiving nack from ${nackSender}`);
Expand All @@ -336,7 +336,7 @@ export class Jerboa {
this.considerProbe(popped, probeId, incarnation, { path: debugInfo.path, backtracked: [nackSender].concat(debugInfo.backtracked) });
}
}
spliceLoop(sender: string, probeId: string, path: string[]): boolean {
spliceLoop(sender: string, probeId: string, incarnation, path: string[]): boolean {
// chop off loop if there is one:
const pos = path.indexOf(this.name);
if (pos !== -1) {
Expand All @@ -349,7 +349,7 @@ export class Jerboa {
// }
// console.log(`Found loop`, loop, ` pos ${pos}`);
if (process.env.PROBING_REPORT) {
console.log(`found loop (${probeId})`, path, loop);
console.log(`found loop (${probeId}:${incarnation})`, path, loop);
}
return true;
}
Expand Down Expand Up @@ -393,7 +393,7 @@ export class Jerboa {
this.considerProbe(sender, probeId, incarnation, debugInfo);
}
considerProbe(sender: string, probeId: string, incarnation: number, debugInfo: { path: string[], backtracked: string[] }): void {
const loopFound = this.spliceLoop(sender, probeId, debugInfo.path);
const loopFound = this.spliceLoop(sender, probeId, incarnation, debugInfo.path);
if (loopFound) {
if (debugInfo.path.length >= 1) {
// console.log(' continuing by popping old sender from', path);
Expand All @@ -415,7 +415,7 @@ export class Jerboa {
return;
} else if (debugInfo.backtracked.length > 0) {
if (process.env.PROBING_REPORT) {
console.log(`backtracked (${probeId})`, debugInfo.path.concat([sender, this.name]), debugInfo.backtracked);
console.log(`backtracked (${probeId}:${incarnation})`, debugInfo.path.concat([sender, this.name]), debugInfo.backtracked);
}
}
// console.log(' did we print?', sender, this.name, path, backtracked);
Expand Down

0 comments on commit 54d50ca

Please sign in to comment.