Retrieving once in a while the response of the request of another user
I have noticed some bizarre behavior in our Rails 6 / Elastic-search-ruby/ Elastic Cloud on Kubernetes setup.
Once or twice per hour, a user receives the results of a query that was executed by another user. I haven't found a way to reproduce it. At this moment, I can only detect it after the event.
Initially, the ElasticSearch client was shared between processes. I thought that could be the causing the problem, so now, for every request to ElasticSearch, a new instance of the ElasticSearch client is created. The problem remains there.
Has anybody experienced this before?
I am using the standard setup and haven't started using Patron or Typhoeus. Could it be related to that?
I finally found an issue in my own Ruby code that caused this to happen.