A while ago, I spent a nightmarish number of weeks dealing with "deadlock detected" and trying to figure out how to handle it. I ended up finally handling it in such a manner that my code is able to detect when it happens and then retry the same query indefinitely with 50000 microseconds in between each retry, until it works.
Maybe that's bad practice, but so far (months), it has not caused any problems except for logging the "deadlock detected" so-called "errors".
Is it "OK" for me to now suppress the "deadlock detected" errors by marking them as "unimportant" and thus not showing up to me, even if they are still logged into my error log table?
Please don't tell me to "avoid them in the first place". This is simply not possible. They will apparently happen if you do concurrent (multiple processes/script instances) working on the same table/thing. I spent forever trying to "code them away", but it just doesn't seem possible.
Obviously, since I'm asking this instead of just adding the ignore rule and being done with it, I do care about the answers/responses. Still, I don't think I can be convinced at this point that they can be avoided completely. I'm not saying that I get thousands of them logged every hour or anything, but a few each day, seemingly always in the beginning when I do have lots of concurrent processes working on the same table/query.
SNAPSHOT
or careful index management to work around. A relatively small number of deadlocks on a busy OLTP database is normal and should always be defended against with retries or user message.