sematext / sematext-agent-java

Sematext Monitoring Agent
https://sematext.com/spm
Apache License 2.0
23 stars 9 forks source link

Standalone agent fails to reconnect to Solr after its restart #77

Closed bsmid closed 4 years ago

bsmid commented 4 years ago

After Solr is stopped, agent's connection fails. Agent internally retries the connection every 60 seconds, but it seems that even after Solr is back, agent isn't able to reconnect. This used to work, so it seems like an issue introduced relatively recently.

bsmid commented 4 years ago

Issue was caused by setting a custom RMISockerFactory (introduced recently to fix issue related to Cassandra and rmi.server.hostname). Repeated tries to set the factory again fail because the factory was already set. The fix is to simply check if the factory was set before or not and just skip that step if it was.