atomikos / transactions-essentials

Development repository for next major release of
https://www.atomikos.com/Main/TransactionsEssentials
Other
462 stars 139 forks source link

In Kubernetes environments the LogFileLock acquiring might fail #189

Open klopfdreh opened 1 year ago

klopfdreh commented 1 year ago

Describe the bug In Kubernetes environments Pods might be terminated and shifted to other Nodes. Because of this the configured log path might be in use if the old Pod is about to terminate and the new one is starting up. To use the same LogFileLock it might be good to implement a retry attempt for the new Pod which is trying to acquire the lock.

To Reproduce Steps to reproduce the behavior:

  1. In Kubernetes create a Job which executes an application inside a Pod
  2. Set the Job to recreate the Pod on deletion
  3. Delete the running Pod which is causing the Pod to be in the "Terminating" state while the new one is started
  4. You will see that the old Pod is holding the Lock as long it is not terminated, but the new Pod is trying to acquire the lock

Additional context I provide a PR.

klopfdreh commented 1 year ago

I set the default to 3 attempts and a delay of 1000 milliseconds - this can be increased if required.