I have just got another idea. Maybe it's good in addition to try obtaining the session a few times before a complete fail - say 3? Or configurable with an env variable and setting the default to 3. Also an extra env variable to enable/disable obtaining new sessions with each file?
Originally posted by @MehmedGIT in https://github.com/OCR-D/core/issues/1200#issuecomment-1993902516