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

Self generated out-of-band UDP can cripple advertisements #120

Closed
justparking opened this Issue Jan 9, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@justparking
Contributor

justparking commented Jan 9, 2018

Under certain rare conditions (network and timing), a self-generated UDP "signal" (as opposed to a valid packet) may be generated and then mishandled. This can result in the crippling of the advertisement thread.

Something like this would be logged:

[pool_Discovery_2] [org.nodel.threading.ThreadPool] An unhandled exception occurred within a thread-pool
java.lang.IllegalArgumentException: port out of range:-1 
at java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143) 
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:188) 
at java.net.DatagramPacket.getSocketAddress(DatagramPacket.java:330) 
at org.nodel.discovery.NodelAdvertiser.processIncomingPacketQueue(NodelAdvertiser.java:288) 
at org.nodel.discovery.NodelAdvertiser.access$000(NodelAdvertiser.java:36) 
at org.nodel.discovery.NodelAdvertiser$1.run(NodelAdvertiser.java:71) 
at org.nodel.threading.ThreadPool.threadMain(ThreadPool.java:303)
at ... 
@justparking

This comment has been minimized.

Show comment
Hide comment
@justparking

justparking Jan 9, 2018

Contributor

As per code comments, .getSocketAddress() can sneakily throw an exception. This was being used in a safe section of some logging code resulting in the unintended crippling of the advertisement thread.

Contributor

justparking commented Jan 9, 2018

As per code comments, .getSocketAddress() can sneakily throw an exception. This was being used in a safe section of some logging code resulting in the unintended crippling of the advertisement thread.

@justparking justparking closed this Jan 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment