elastic4s icon indicating copy to clipboard operation
elastic4s copied to clipboard

Timeout on close() when client is down

Open tiphdousset opened this issue 2 years ago • 1 comments

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 ???

tiphdousset avatar Jun 01 '22 21:06 tiphdousset

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.

stale[bot] avatar Aug 12 '22 04:08 stale[bot]