cloud-software-foundation / c5

c5
Apache License 2.0
12 stars 8 forks source link

Improve message when BeaconService can't find any local IPs #310

Closed joshua-g closed 10 years ago

joshua-g commented 10 years ago

Previously, when BeaconService could not find any IP address for its node, it broadcasted an empty address list; that caused an IndexOutOfBoundsException when clients tried to get the first address in the list. The list should never be empty or else the broadcast was pointless.

This PR changes BeaconService so if it can't find any local IP address, it logs a warning message; and then it does not bother sending out any broadcasts. It still remains available for local modules' use, however.

I tested it by manually changing the getLocalIPs() method to return an empty list, and manually verifying the correct behavior while running C5GeneralizedReplicationServiceTest.

posix4e commented 10 years ago

Looks like https://circleci.com/gh/joshua-g/c5/31 passed