[Log4cplus-devel] [log4cplus:bugs] #334 this may be a rarely occurred bug of AsyncAppender
Logging Framework for C++
Brought to you by:
wilx
From: Václav H. <wi...@us...> - 2017-01-30 21:07:32
|
- **labels**: --> bug, threads - **status**: open --> closed - **assigned_to**: Václav Haisman - **Comment**: I think this is fixed by handling the `EINTR`. --- ** [bugs:#334] this may be a rarely occurred bug of AsyncAppender** **Status:** closed **Group:** v1.1.3 **Labels:** bug threads **Created:** Fri Sep 02, 2016 12:20 PM UTC by owenliang **Last Updated:** Sun Jan 29, 2017 10:09 PM UTC **Owner:** Václav Haisman sorry for my poor english first... the code is in /src/queue.cxx, the function "get_events", ~~~{.cpp} else if (((EXIT | QUEUE) & flags) == (EXIT | QUEUE)) { assert (! queue.empty ()); queue.clear (); flags &= ~QUEUE; ev_consumer.reset (); sem.unlock (); // look at here ret_flags = flags; break; } ~~~ the story goes like this: 1, all threads that is calling "asyncAppender::append()" hang on the Semaphore of queue, because the consumer thread is doing a heavy IO outputing and then has no time to process the queue full of events. 2, one of these threads' sem_wait is interrupt by a signal, then AsyncAppender::append() will call queue::signal_eixt(false) to terminal the consumer thread. (flags=EXIT|QUEUE) 3, consumer thread finish IO and loop again, then will go into the code above in the next loop. 4, sem.unlock() is just called once, and then the consumer thread exit. 5, all the other threads which is hanging on Semaphore will never exit. take a look && help me , thanks. --- Sent from sourceforge.net because log...@li... is subscribed to https://sourceforge.net/p/log4cplus/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/log4cplus/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |