Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

A question about dialWorkerLoop #304

Closed
tanqiangyes opened this issue Dec 20, 2021 · 12 comments
Closed

A question about dialWorkerLoop #304

tanqiangyes opened this issue Dec 20, 2021 · 12 comments

Comments

@tanqiangyes
Copy link

In swarm_dial.go the dialWorkerLoop function has an active variable inside, when case res := <-resch:, active--, then in this case will determine active==0, but this time active is not certainly less than 0? I don't see active++ or an assignment operation elsewhere. Please help me solve this problem, thank you.

@tanqiangyes
Copy link
Author

my git submit log is 5155c770

@marten-seemann
Copy link
Contributor

@vyzo, can you help out here?

@vyzo
Copy link
Contributor

vyzo commented Dec 21, 2021 via email

@tanqiangyes
Copy link
Author

tanqiangyes commented Dec 21, 2021

Yes, logically, I don't think you are doing anything with this active, and many of the conditions about it are not valid. So, is this a logic problem or is there something that is not yet done?

@vyzo
Copy link
Contributor

vyzo commented Dec 21, 2021 via email

@tanqiangyes
Copy link
Author

Okay, looking forward to the fix.

@vyzo
Copy link
Contributor

vyzo commented Dec 21, 2021

#305 fixes the issue.

@vyzo vyzo closed this as completed Dec 21, 2021
@tanqiangyes
Copy link
Author

Can you tell us why you have this logic? Because I tried to fix it, but I don't know why you wrote it that way.

@vyzo
Copy link
Contributor

vyzo commented Dec 21, 2021

so that we can collect all pending dial results after the request channel has been closed; basically control short-circuits.

@tanqiangyes
Copy link
Author

Okay, does this bug affect specific businesses?

@vyzo
Copy link
Contributor

vyzo commented Dec 21, 2021

I don't think so, it's a corner case.

@tanqiangyes
Copy link
Author

Ok, thanks for the reply. I'm currently learning the libp2p code, and I'm learning a lot, so thanks for your efforts.

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

No branches or pull requests

3 participants