Dirk Meyer wrote:
> Duncan Webb wrote:
>> I have this in __main__, so I would expect the Ctrl-C exit (basically
>> the stop command) to print something.
>> |try:
>> | main()
>> |except Exception, why:
>> | traceback.print_exc()
>> | print why
>> |print 'done.'
>
> You will not see print why because SystemExit will be handled
> internally and kaa.main.run would just stop without exception. But you
> should see 'done'
Exactly what happens
> Looking at current rel-1:
>
> | try:
> | # signal handler
> | signal.signal(signal.SIGTERM, signal_handler)
> | signal.signal(signal.SIGINT, signal_handler)
> |
> | [...]
> |
> | kaa.main.run()
> |
> |
> | except KeyboardInterrupt:
> | print 'Shutdown by keyboard interrupt'
> | # Shutdown the application
> | shutdown()
> |
> | except SystemExit:
> | pass
> |
> | except Exception, e:
> | _debug_('Crash!: %s' % (e), config.DCRITICAL)
>
> Please remove the signal handler here, let kaa base handle this. You
> will also _never_ see 'Shutdown by keyboard interrupt' because kaa
> handles this as well. If you want to clean up on shutdown, either
> register a callback to kaa.main.siganls['shutdown'] or do this after
> all exception handling. BTW, you will also never run into except
> SystemExit.
I've added some prints into notifier main and the signal handler never
gets called, after pressing ctrl-c.
What happens is that the signal handler is installed at the very
beginning of the program. This is before DirectFB is started and I guess
that DirectFB installed it's own signal handlers and the last installed
signal handler is used first so DirectFB exits before kaa has seen the
ctrl-c.
Freevo runs twice at start up, so it looks like the kaa signal handler
is not being installed
>> I suspect that the problem lies with kaa.rpc / async, it seems that once
>> an rpc calls has been made freevo won't shut down any more. The log
>> shows that there are a lot of channels opened but not closed.
>
> My kaa application using kaa.rpc (like beacon) shut down when kaa.rpc
> is used. Another question is, why you have more than one channel? You
> can reuse the channel for as much rpc calls as you like.
I see why now every RecordClient instance make a new connection, so
every module that uses RecordClient makes a new connection. I've changed
this.
Duncan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel