http://bugzilla.moblin.org/show_bug.cgi?id=7555
--- Comment #10 from yongsheng zhu <yongsheng.zhu(a)intel.com> 2009-11-08 17:18:11
---
(In reply to comment #8)
(In reply to comment #7)
> (In reply to comment #6)
> > While testing with test-dbus.py I noticed that the server was not shut down
> > reliably after running a sync. I think that was a timing issue: if the SIGTERM
> > arrived after running a sync and before returning into the syncevo-dbus-server
> > main loop, g_main_loop_quit() would be called outside of the loop, thus doing
> > nothing, so that the signal was ignored.
> If loop is running, quit_loop won't do anything about loop. I add below code
> to check while in the DBusServer::run(). You can find them in the branch
> 'origin/yongsheng'.
>
>
> --- a/src/syncevo-dbus-server.cpp
> +++ b/src/syncevo-dbus-server.cpp
> @@ -2561,12 +2561,6 @@ void DBusServer::run()
> // running a sync and quitting; no active session, so quit
> break;
> }
> + /** check whether receiving CTRL-C/SIGINT/SIGTERM and aborting
> syncevo-dbus-server */
> + SuspendFlags flags = SyncContext::getSuspendFlags();
> + if(flags.state == SuspendFlags::CLIENT_SUSPEND ||
> + flags.state == SuspendFlags::CLIENT_ABORT ) {
> + break;
> + }
What about the case that we are in DBusServer::run() and outside of
SyncContext::doSync()? In that case the active signal handler is the niam()
function in syncevo-dbus-server. It doesn't set SyncContext::getSuspendFlags().
There's another problem related to this: Session::abort/suspend() do not tell
the DBusTransportAgent to return control. Because of that, the user cannot
abort a session when no messages are coming in. The timeout mechanism would
help, but isn't implemented yet, so abort() really has no effect at all.
Are you done with the code? I'm working on these other aspects of the code at
the moment, so I should take over and try fix these problems together.
(In reply to comment #8)
(In reply to comment #7)
> (In reply to comment #6)
> > While testing with test-dbus.py I noticed that the server was not shut down
> > reliably after running a sync. I think that was a timing issue: if the SIGTERM
> > arrived after running a sync and before returning into the syncevo-dbus-server
> > main loop, g_main_loop_quit() would be called outside of the loop, thus doing
> > nothing, so that the signal was ignored.
> If loop is running, quit_loop won't do anything about loop. I add below code
> to check while in the DBusServer::run(). You can find them in the branch
> 'origin/yongsheng'.
>
>
> --- a/src/syncevo-dbus-server.cpp
> +++ b/src/syncevo-dbus-server.cpp
> @@ -2561,12 +2561,6 @@ void DBusServer::run()
> // running a sync and quitting; no active session, so quit
> break;
> }
> + /** check whether receiving CTRL-C/SIGINT/SIGTERM and aborting
> syncevo-dbus-server */
> + SuspendFlags flags = SyncContext::getSuspendFlags();
> + if(flags.state == SuspendFlags::CLIENT_SUSPEND ||
> + flags.state == SuspendFlags::CLIENT_ABORT ) {
> + break;
> + }
What about the case that we are in DBusServer::run() and outside of
SyncContext::doSync()? In that case the active signal handler is the niam()
function in syncevo-dbus-server. It doesn't set SyncContext::getSuspendFlags().
If outside of SyncContext::doSync(), then signals are caught by niam() and
eventually the process exits.
There's another problem related to this: Session::abort/suspend()
do not tell
the DBusTransportAgent to return control. Because of that, the user cannot
abort a session when no messages are coming in. The timeout mechanism would
help, but isn't implemented yet, so abort() really has no effect at all.
Are you done with the code? I'm working on these other aspects of the code at
the moment, so I should take over and try fix these problems together.
No, so you
can go forward.
(In reply to comment #9)
abort() also doesn't shut down the connection, therefore the
Session gets stuck
in its shutdown waiting for the peer. Fixing it...
We really need tests for these API calls ;-}
Yes, really. I'd read your
test-dbus.py and add more tests for these APIs
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching someone on the CC list of the bug.