NTLM auth error (server hangs)

Moderator: crythias

Locked
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

NTLM auth error (server hangs)

Post by artjoms15 »

Well, I've noticed one thing:
We have HTTP Basic Auth implemented by using Apache2::AutenNTLM and sometimes it acts really weird - Apache just stop responding (usually after some idle time) imagine that you type in customer.pl and the browser keeps loading the page and the screen keeps blank. In httpd/error_log I see this message:
[xxxx] AuthenNTLM: timed outwhile waiting for lock (key = 23754)

service restarts successfuly solves the problem, till the next issue (approx once a week or so)
All other processes are alive - cron is runing, messages are sent, the only problem is with this NTLM auth module :(

As I googled, it seems like a semaphore issue, maybe someone got similar problem and have successfuly solved it?

Thanks in Advance,
A.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: NTLM auth error (server hangs)

Post by jojo »

Don't ue NTLM as it is quite old and crappy.

Kerberos is much better and more stable
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: NTLM auth error (server hangs)

Post by artjoms15 »

Yeah it is old, but nevermind - it is good enough for simple intranet helpdesk implementation.
BTW solved the issue with those rare hangs...
As I thought the problem was with semaphores - they were freed improperly, it means that the value of the resource counter was freed before it was freed in reality => if some request would interrupt the semaphore change the counter would decrease and the resource wouldn' t be freed (Yeah, it sounds freaky, but it is as I understood the semaphores from my university :D)
Well, in one word - replace code in authenntlm.pm

Code: Select all

sub DESTROY{
......
$self->{sem}->op(0, -1, SEM_UNDO);
......
}
with

Code: Select all

sub DESTROY{
......
$self->{sem}->op(0, -1, IPC_NOWAIT)
......
}
Found this solution in one blog and understood that the guy is right - it really helps for those hangs

Anyways will think about Kerberos, because NTLM is not supported in win 7 :(
Thanks for advice :)
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Locked