Open afharo opened 5 months ago
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)
Hey @afharo, thanks for bringing this to our attention, is it a general recommendation for the xpack plugins to retry?
Is there's any documentation or guidance around that, like how many retries should we do until consider it failed? any information would be appreciated!
is it a general recommendation for the xpack plugins to retry?
IMO, if there's any setup process involved, and Kibana will assume it succeeded later on, it should be retried.
I don't think we have any guidance about how many retries are necessary, sorry.
@afharo thanks for bringing this up. I did a quick scan to see if other plugins were doing this and could not find any. Can you reference a plugin that does this for our reference?
It is true that we have a very naive setup experience in Kibana (that's why I created all the issues tracked in https://github.com/elastic/kibana/issues/182291). And examples are scarce.
This is one example: https://github.com/elastic/kibana/blob/f442a0dd6b006ba3e0025517064aad117253bb0b/src/plugins/content_management/server/event_stream/es/init/es_event_stream_initializer.ts#L26-L35
Here's another one: https://github.com/elastic/kibana/blob/35b7b08595d02964c1931beb2f9d52634268b82c/x-pack/plugins/event_log/server/es/init.ts#L31-L46
Oh, I see now, thanks @afharo for the examples. 🚀
@kfirpeled, how do we want to proceed with this?
The promise below might fail in case there's a glitch in ES connection and never retry.
https://github.com/elastic/kibana/blob/593d3911728cf68093925836ae2031746c7db6cd/x-pack/plugins/cloud_security_posture/server/plugin.ts#L106-L113
Is that OK? Should we apply any retry logic?
If we want to retry,
p-retry
could be a useful utility that's already present in the project.