[Home]

Summary:ASTERISK-12007: The device state change thread gets locked (or waits) for 20 seconds
Reporter:ptorres (ptorres)Labels:
Date Opened:2008-05-12 11:44:59Date Closed:2011-06-07 14:00:45
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) gdb.txt
( 1) locks.txt
( 2) log_output.txt
Description:
Device state becomes inconsistent, avaiable agents are seen as busy etc , right from the first few calls after service start.

checking logs we see many more insertions to the 'change state' list than the few ones that actually change every time it is unlocked



****** STEPS TO REPRODUCE ******

We replicated the configuration in another server and were unable to reproduce.

****** ADDITIONAL INFORMATION ******

we tried 1.4.19 , it did not work well either and crashed a lot

1.4.18 compiled with DETECT_DEADLOCKS, it worked a bit better, but still too slow.
Comments:By: ptorres (ptorres) 2008-05-12 11:59:31

locks.txt contains 'core show locks' output
log_output.txt contains a sample of messages related to state change
gdb.txt , bt thread apply all bt output while running

(1.4.18 doesn't crash , when 1.4.19 crashes does not seem to be related to this. )



By: ptorres (ptorres) 2008-05-13 16:54:30

I think we have found something... and it is probably not a bug but related to a previous change which added support to hyphens in device/peer names ( __ast_device_state_changed_literal in devicestate.c )

(currently in 1.4.18)
a state change is queued for 'peer-8bcad123' (and recursively a state change is queued for 'peer')
but since 'peer-8bcad123' is a channel and not a device it wont be find and finally chan_sip will do a dns query (this is where it waits 20 seconds because the server had dns configured but not reachable)

what happened before was (we used 1.4.12)
state change is queued for 'peer-8bcad123' ( but the '-' and chars after were later ignored )

For the time being we are going to revert this change because our application will not create peers with hyphens, until we can find a better solution :)

I guess we can close this.

By: Joshua C. Colp (jcolp) 2008-05-14 10:29:52

Closed per comment.