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 user exist we can stop now
|
||||||
if (getUserIdFromDB()) {
|
if (getUserIdFromDB()) {
|
||||||
addError(param_error_order_id);
|
//addError(param_error_order_id);
|
||||||
sendErrorsAsEmail();
|
//sendErrorsAsEmail();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,15 +6,23 @@ namespace UniLib {
|
|||||||
|
|
||||||
void MultithreadContainer::lock(const char* stackDetails/* = nullptr*/)
|
void MultithreadContainer::lock(const char* stackDetails/* = nullptr*/)
|
||||||
{
|
{
|
||||||
|
const static char* functionName = "MultithreadContainer::lock";
|
||||||
try {
|
try {
|
||||||
mWorkMutex.lock(500);
|
mWorkMutex.lock(500);
|
||||||
|
if (stackDetails) {
|
||||||
|
mLastSucceededLock = stackDetails;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Poco::TimeoutException& ex) {
|
catch (Poco::TimeoutException& ex) {
|
||||||
ErrorList errors;
|
ErrorList errors;
|
||||||
if (stackDetails) {
|
errors.addError(new ParamError(functionName, "lock timeout", ex.displayText()));
|
||||||
errors.addError(new Error("MultithreadContainer::lock", stackDetails));
|
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();
|
errors.sendErrorsAsEmail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,10 +44,11 @@ namespace UniLib {
|
|||||||
|
|
||||||
void lock(const char* stackDetails = nullptr);
|
void lock(const char* stackDetails = nullptr);
|
||||||
|
|
||||||
inline void unlock() {mWorkMutex.unlock();}
|
inline void unlock() { mLastSucceededLock = ""; mWorkMutex.unlock(); }
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
Poco::Mutex mWorkMutex;
|
Poco::Mutex mWorkMutex;
|
||||||
|
std::string mLastSucceededLock;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "TransactionTransfer.h"
|
#include "TransactionTransfer.h"
|
||||||
|
|
||||||
|
const std::string TransactionTransfer::mInvalidIndexMessage("invalid index");
|
||||||
|
|
||||||
TransactionTransfer::KontoTableEntry::KontoTableEntry(User* user, google::protobuf::int64 amount, bool negativeAmount/* = false*/)
|
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)
|
const std::string& TransactionTransfer::getKontoNameCell(int index)
|
||||||
{
|
{
|
||||||
|
|
||||||
lock();
|
lock();
|
||||||
if (index >= mKontoTable.size()) {
|
if (index >= mKontoTable.size()) {
|
||||||
unlock();
|
unlock();
|
||||||
return "invalid index";
|
return mInvalidIndexMessage;
|
||||||
}
|
}
|
||||||
unlock();
|
unlock();
|
||||||
|
|
||||||
@ -147,7 +148,7 @@ const std::string& TransactionTransfer::getAmountCell(int index)
|
|||||||
lock();
|
lock();
|
||||||
if (index >= mKontoTable.size()) {
|
if (index >= mKontoTable.size()) {
|
||||||
unlock();
|
unlock();
|
||||||
return "invalid index";
|
return mInvalidIndexMessage;
|
||||||
}
|
}
|
||||||
unlock();
|
unlock();
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ public:
|
|||||||
const std::string& getAmountCell(int index);
|
const std::string& getAmountCell(int index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
const static std::string mInvalidIndexMessage;
|
||||||
struct KontoTableEntry {
|
struct KontoTableEntry {
|
||||||
public:
|
public:
|
||||||
KontoTableEntry(User* user, google::protobuf::int64 amount, bool negativeAmount = false);
|
KontoTableEntry(User* user, google::protobuf::int64 amount, bool negativeAmount = false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user