mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
more infos for finding dead lock
This commit is contained in:
parent
75038be86a
commit
03804ed24a
@ -274,8 +274,8 @@ int HandleElopageRequestTask::run()
|
||||
|
||||
// if user exist we can stop now
|
||||
if (getUserIdFromDB()) {
|
||||
addError(param_error_order_id);
|
||||
sendErrorsAsEmail();
|
||||
//addError(param_error_order_id);
|
||||
//sendErrorsAsEmail();
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
@ -6,15 +6,23 @@ namespace UniLib {
|
||||
|
||||
void MultithreadContainer::lock(const char* stackDetails/* = nullptr*/)
|
||||
{
|
||||
const static char* functionName = "MultithreadContainer::lock";
|
||||
try {
|
||||
mWorkMutex.lock(500);
|
||||
if (stackDetails) {
|
||||
mLastSucceededLock = stackDetails;
|
||||
}
|
||||
}
|
||||
catch (Poco::TimeoutException& ex) {
|
||||
ErrorList errors;
|
||||
if (stackDetails) {
|
||||
errors.addError(new Error("MultithreadContainer::lock", stackDetails));
|
||||
errors.addError(new ParamError(functionName, "lock timeout", ex.displayText()));
|
||||
if (mLastSucceededLock != "") {
|
||||
errors.addError(new ParamError(functionName, "last succeed lock by ", mLastSucceededLock.data()));
|
||||
}
|
||||
errors.addError(new ParamError("MultithreadContainer::lock", "lock timeout", ex.displayText()));
|
||||
if (stackDetails) {
|
||||
errors.addError(new Error(functionName, stackDetails));
|
||||
}
|
||||
|
||||
errors.sendErrorsAsEmail();
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,10 +44,11 @@ namespace UniLib {
|
||||
|
||||
void lock(const char* stackDetails = nullptr);
|
||||
|
||||
inline void unlock() {mWorkMutex.unlock();}
|
||||
inline void unlock() { mLastSucceededLock = ""; mWorkMutex.unlock(); }
|
||||
protected:
|
||||
private:
|
||||
Poco::Mutex mWorkMutex;
|
||||
std::string mLastSucceededLock;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "TransactionTransfer.h"
|
||||
|
||||
|
||||
const std::string TransactionTransfer::mInvalidIndexMessage("invalid index");
|
||||
|
||||
TransactionTransfer::KontoTableEntry::KontoTableEntry(User* user, google::protobuf::int64 amount, bool negativeAmount/* = false*/)
|
||||
{
|
||||
@ -133,10 +133,11 @@ int TransactionTransfer::prepare()
|
||||
|
||||
const std::string& TransactionTransfer::getKontoNameCell(int index)
|
||||
{
|
||||
|
||||
lock();
|
||||
if (index >= mKontoTable.size()) {
|
||||
unlock();
|
||||
return "invalid index";
|
||||
return mInvalidIndexMessage;
|
||||
}
|
||||
unlock();
|
||||
|
||||
@ -147,7 +148,7 @@ const std::string& TransactionTransfer::getAmountCell(int index)
|
||||
lock();
|
||||
if (index >= mKontoTable.size()) {
|
||||
unlock();
|
||||
return "invalid index";
|
||||
return mInvalidIndexMessage;
|
||||
}
|
||||
unlock();
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ public:
|
||||
const std::string& getAmountCell(int index);
|
||||
|
||||
protected:
|
||||
const static std::string mInvalidIndexMessage;
|
||||
struct KontoTableEntry {
|
||||
public:
|
||||
KontoTableEntry(User* user, google::protobuf::int64 amount, bool negativeAmount = false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user