Show owner query ids in the message for the DEADLOCK_AVOIDED error.

This commit is contained in:
Vitaly Baranov 2023-12-03 14:04:54 +01:00
parent dc83e27164
commit f1ccf4e29f

View File

@ -41,8 +41,8 @@ RWLockImpl::LockHolder IStorage::tryLockTimed(
{ {
const String type_str = type == RWLockImpl::Type::Read ? "READ" : "WRITE"; const String type_str = type == RWLockImpl::Type::Read ? "READ" : "WRITE";
throw Exception(ErrorCodes::DEADLOCK_AVOIDED, throw Exception(ErrorCodes::DEADLOCK_AVOIDED,
"{} locking attempt on \"{}\" has timed out! ({}ms) Possible deadlock avoided. Client should retry", "{} locking attempt on \"{}\" has timed out! ({}ms) Possible deadlock avoided. Client should retry. Owner query ids: {}",
type_str, getStorageID(), acquire_timeout.count()); type_str, getStorageID(), acquire_timeout.count(), rwlock->getOwnerQueryIdsDescription());
} }
return lock_holder; return lock_holder;
} }