-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
IllegalArgumentException appears in the log #5849
Comments
@ss334452 Do you know what can cause this issue? |
@halibobo1205 This problem should be due to multi-threaded concurrent access, which causes the peer sorting value to be changed during sorting.
For example, a node establishes connections with peer A and peer B at the same time. When processing a hello message, when peer A thread calls the |
@zeusoo001 Has the probability of this concurrency issue been evaluated? Are there any good methods to reproduce this issue? |
@jwrct The probability of this concurrency issue occurring is extremely low. Currently, it can only be reproduced through scripts. |
@zeusoo001 Is this exception impact on the system greatly ? |
@ss334452 It will only cause the handshake to fail and the connection to be disconnected, without affecting other connections and functions. Since the probability is extremely small, it has almost no impact on the system. |
@zeusoo001 Is there any good solution to this concurrency problem? |
@ss334452 The two logics can be bundled together to solve the concurrency problem. The modification is as follows:
change to
The impact of sorting failure is minimal, so there is no need to handle exceptions specially. |
@zeusoo001 Very good, I agree with this solution. |
@zeusoo001 Why is there a try-catch exception handling in your modified code? Is it because even after this modification, there will still be concurrency issues? |
@fyyhtx Yes, libp2p channel keepalive will also call this method |
@zeusoo001 Is the goal of the modification to address concurrency issues or to handle exceptions? If it is for handling exceptions, you can simply try catching the exception thrown by sort, what do you think? Please confirm how much impact a failed sort would have. |
@fyyhtx I think your solution is OK. The failure of sortPeers will only affect this sorting and will not have any impact on the system. In addition, the probability of concurrent problems is extremely low. I can refer to your modification plan. The code modification is as follows:
|
Software Versions
GreatVoyage-v4.7.5(Cleobulus)
OS : Linux
JVM : Oracle Corporation 1.8.0_161 amd64
Expected behaviour
No exceptions should occur.
Actual behaviour
In issue 5847 , I saw an IllegalArgumentException thrown in the posted log.
The text was updated successfully, but these errors were encountered: