[ace-bugs] [ACE]: [calling purge_pending_notifications() before notify() leads to dead-lock]

Steve Huston shuston at riverace.com
Tue Nov 29 10:07:18 CST 2016


Correct - there is no way to purge the pipe. It must be emptied by the reactor loop internally. So you must allow the loop to run. Note that the logic to prevent more bytes from being written to the pipe when there should already be a notify in the pipe is defeated when you keep purging the notification queue.

-Steve

From: Jack Wong [mailto:pandawkx at 163.com]
Sent: Monday, November 28, 2016 7:40 PM
To: Steve Huston <shuston at riverace.com>
Cc: ace-bugs at list.isis.vanderbilt.edu
Subject: Re:Re: [ace-bugs] [ACE]: [calling purge_pending_notifications() before notify() leads to dead-lock]

Steve:

"let the reactor event loop run and read things from the notify pipe" may be not a good idea.

Notify pipe has limited buffer . When put too much bytes to the write end,soon buffer will be full and write operation will be blocked.

As checking the current implement codes, I found that the designer may intend to keep only one message in the pipe to avoid buffer becoming full and keep plenty of messages in the queue.

The problem is you can purge messages in the queue but you can not easily purge messages in the pipe.

-Jack Wong




At 2016-11-29 00:43:07, "Steve Huston" <shuston at riverace.com<mailto:shuston at riverace.com>> wrote:

Thank you for the problem info and research into it.

The easiest way to resolve this is to let the reactor event loop run and read things from the notify pipe.

-Steve

On Nov 28, 2016, at 3:12 AM, Jack Wong <pandawkx at 163.com<mailto:pandawkx at 163.com>> wrote:

ACE VERSION: 6.3.0
(this bug still exists in version 6.4.0)

Our test codes looks like this:

1:while (true)
2:{
3:    reactor()->purge_pending_notifications(xxx);
4:    reactor()->notify(xxx);
5:}

after a while , we found dead-lock occurs at  line 4.

−−−−−−−−−−−−−−−−−−−−−−−−−

I check the code and found that :

purge_pending_notifications can only purge message in notify queue

messages in pipe can not be purged

so calling notify() after purge_pending_notifications() can always leads one message be write to pipe

So when I keep calling like this , soon buffer of pipe will full and notify() will be blocked , then dead-lock occurs

−−−−−−−−−−−−−−−−−−−−−−−−−

we are using this two interfaces building important functions of our application

we will appreciate it if this bug being fixed soon

−−−−−−−−−−−−−−−−−−−−−−−−−

poor English, sorry!


_______________________________________________
ace-bugs mailing list
ace-bugs at list.isis.vanderbilt.edu<mailto:ace-bugs at list.isis.vanderbilt.edu>
http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/ace-bugs




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/ace-bugs/attachments/20161129/f46a59ce/attachment-0001.html>


More information about the ace-bugs mailing list