elastic4s
elastic4s copied to clipboard
Timeout on close() when client is down
Following situation in my service:
- I create a resource based on my ESClient
- My service can connect, and some requests are successfully executed
- Somehow the ES instance is down
- My service receive a request
- But
s.close()
runs for ever because it can't close anything since the connexion has been lost
=> is there a way to give a timeout to the close() function? Or am I missing something obvious here?
I'm using v7.12.0
of elastic4s and can't upgrade more because my service is still using cats effect 2.
I've tried to add a timeout to the execute command and to myESClient but both did not have any influence for the close().
val resource = Resource.make(IO(myESClient))(s => IO(s.close()))
for {
response <- resource.use(_.execute(myESRequest))
} yield ???
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.