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'

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 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 applicatiosn 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.

> So what is the criteria that determines when a new channel is opened
> and an existing channel is closed.

A channel should never close except the peer dies.


Dischi

-- 
"A Computer is a state machine.
 Threads are for people who can't program state machines."
      - Alan Cox

Attachment: pgpYu6PEQijN6.pgp
Description: PGP signature

-------------------------------------------------------------------------
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
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to