Tries to locate the the thread id. If it is not found we try until max_attempts. Throws if no thread id was found.
See Source File