Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipleResolves log message #3881

Closed
air1one opened this issue Jul 8, 2020 · 1 comment
Closed

multipleResolves log message #3881

air1one opened this issue Jul 8, 2020 · 1 comment
Assignees

Comments

@air1one
Copy link
Contributor

air1one commented Jul 8, 2020

We get a log message right after forging that looks like this :

0|core  |  ℹ  multipleResolves (a promise was resolved multiple times) 
0|core  | Initially resolved with: [
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined, undefined, undefined,
0|core  |   undefined, undefined
0|core  | ]
0|core  | Then resolved again with: undefined

We need to investigate and fix the issue.

@sebastijankuzner
Copy link
Contributor

The message is caused by Promise.race in:

// we use Promise.race to cut loose in case some communicator.ping() does not resolve within the delay
// in that case we want to keep on with our program execution while ping promises can finish in the background
await Promise.race([
Promise.all(
peers.map(async peer => {
try {
await this.communicator.ping(peer, pingDelay, forcePing);
} catch (error) {
unresponsivePeers++;
if (peerErrors[error]) {
peerErrors[error].push(peer);
} else {
peerErrors[error] = [peer];
}
this.emitter.emit("internal.p2p.disconnectPeer", { peer });
this.emitter.emit(ApplicationEvents.PeerRemoved, peer);
return undefined;
}
}),
),
delay(pingDelay),
]);

Nothing unusual is happening, because race method is causing "multipleResolves" events as described in nodejs docs. We are also logging all process errors with log-process-errors package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants