skydive-project / skydive

An open source real-time network topology and protocols analyzer
https://skydive.network
Apache License 2.0
2.65k stars 400 forks source link

Race condition loading initial data from ElasticSearch #2415

Open adrianlzt opened 2 years ago

adrianlzt commented 2 years ago

Today we found a race condition with an ElasticSearch starting at the same time of Skydive.

Skydive was able to start the ES client but then failed to get the data from the live index.

The query function does not allow to return an error, so in case of error only an error log is generated.

I'm not sure how this could be handled. Maybe Skydive should refuse to start if it fails to load the data? In this case, some work would be needed to handle those errors in the Query function and the callers.