Bill,
class SessionManager : public Singleton<SessionManager>
Is not thread safe... This patch adds a critical section to SessionManager::CreateConnection
Patch not regression tested. Patch tested on live loaded system. Went from daily+ hangs to none.
PS: We have a monitoring system which is set to test SMTP/POP/IMAP every minute and alarm if not available. When you are testing SMTP 587, 25 (IP1), 25 (IP2), POP, IMAP every minute, you get more collisions than when not testing...
Attached files have only two lines added:
SessionManager.h From
================
private:
long m_iNoOfSMTPConnections;
================
SessionManager.h To
================
private:
CriticalSection m_oCritSec;
long m_iNoOfSMTPConnections;
================
SessionManager.cpp From
================
SessionManager::CreateConnection(SessionType t, shared_ptr<SecurityRange> securityRange)
{
shared_ptr<ProtocolParser> pParser;
================
SessionManager.cpp To
================
SessionManager::CreateConnection(SessionType t, shared_ptr<SecurityRange> securityRange)
{
CriticalSectionScope scope(m_oCritSec);
shared_ptr<ProtocolParser> pParser;
================
hmailserver stops working/hangs/IOCPQueueWorkerTask patch
hmailserver stops working/hangs/IOCPQueueWorkerTask patch
- Attachments
-
- SessionManagerPatch.zip
- (1.71 KiB) Downloaded 358 times
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
Thanks! You'll be many people's hero if this fixes that problem. I'll check it out & get a test build posted so people can test it out. How did you manage to find that one? lol
Bill
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
Posted up an experimental build asking people to test the indexing & iocp related changes:
http://www.hmailserver.com/forum/viewto ... 02#p155302
http://www.hmailserver.com/forum/viewto ... 02#p155302
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
Bill,
I started at the at the error message in the code and followed it back.
I started at the at the error message in the code and followed it back.
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
"Luckily" you had the crashes happening. martin & I have not been able to duplicate the errors which makes it real fun to trace. Once you find it & see the critical line you say "duh" but it's like a needle in a haystack. The crazy thing is how it only happens to some people in some setups. Even low load/traffic servers which really made no sense or bad luck it seems. lolgreylock wrote:Bill,
I started at the at the error message in the code and followed it back.
Thx
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
Not sure if this thread is dead but I'll give it a try
What part of the thread is it that actually required a critical section?
I would guess it's the reading of the variables m_iNoOfSMTPConnections/m_iNoOfPOP3Connections/m_iNoOfIMAPConnections?
What part of the thread is it that actually required a critical section?
I would guess it's the reading of the variables m_iNoOfSMTPConnections/m_iNoOfPOP3Connections/m_iNoOfIMAPConnections?
Re: hmailserver stops working/hangs/IOCPQueueWorkerTask patc
Martin,
I believe it was the shared pointer.
I believe it was the shared pointer.