[Home]

Summary:ASTERISK-12116: if queue_log file is FIFO asterisk do deadlock after "logger reload"
Reporter:Badalian Vyacheslav (slavon)Labels:
Date Opened:2008-05-30 04:37:13Date Closed:2008-06-03 14:01:03
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hello.
if queue_log file created as FIFO asterisk do deadlock after "logger reload" (try do it few times)

If FIFO unsupported * must recreate file or write error to screen? Or add please support (if it not a bug) to log to FIFO.

Thanks!
Comments:By: Tilghman Lesher (tilghman) 2008-05-30 09:21:36

What do you mean by 'deadlock'?  Do you have the output of 'core show locks'?

By: Mark Michelson (mmichelson) 2008-06-02 17:38:39

I tried this and as long as I had some process reading from the FIFO, I never experienced a lock-up. If I had no process attempting to read, then all write calls to the FIFO would block forever.

By: Badalian Vyacheslav (slavon) 2008-06-03 00:27:39

yes! if reader process was killed - asterisk do strange thinks like locks...

This my process (i memory all that i do) =)

rm /var/log/asterisk/queue_log
mkfifo /var/log/asterisk/queue_log
asterisk -r
# logger reload
# exit
tail -f /var/log/asterisk/queue_log
--- no data - CTRL+C hm... try return changes...
rm /var/log/asterisk/queue_log
asterisk -r
# logger reload
# exit
ls /var/log/asterisk/queue_log
--- no file.. logger never recreate file... maybe logger process is lock?
asterisk -r
# stop now
---- HMMM... ITS NOT STOP! Strange!
kill -9 asterisk
asterisk -gT
---- ohhh... great! =)

By: Badalian Vyacheslav (slavon) 2008-06-03 00:28:49

logger reload i try few times after delete FIFO

By: Mark Michelson (mmichelson) 2008-06-03 11:39:55

Okay, when you get this to happen, could you get the output of "core show locks" from the CLI? Also, please provide a backtrace of all the threads when this happens. Thanks.

I tried reproducing this myself, and the only way I could make a "logger reload" or "stop now" command hang was if the queue_log was a FIFO and there was no process to read from it. If I deleted the FIFO and ran "logger reload" the queue_log would be recreated as a regular file and everything worked properly for me.

By: Russell Bryant (russell) 2008-06-03 14:01:02

This is the downside of using a fifo.  There is nothing we can do about it.