Re: [Twisted-Python] Need Exception that will stop ther reactor within twistd
On 30 Nov, 08:00 pm, ncesar@lunix.com.ar wrote:
my apologies for the delayed answer, i've been very busy latelly.
No problem, aren't we all.
El Martes, 28 de Noviembre de 2006 06:07, glyph@divmod.com escribi�:
Should the webserver stop simply because your protocol is not working?
Well, yes I agree with you: not a webserver. So, I'll shortly describe my application.
My point is that you are artificially combining your application with your infrastructure. The reactor is always potentially in use by multiple applications, so it is not the thing that should be stopped.
I have multiple LSTP (Linux Terminal Server Project) servers. All servers are (almost) the same, and any of them can serve any client. There are arround 8-12 servers and 150+ clients. I'm developing a twisted application that balances clients requests (by filtering DHCP discover/requests packets. (I attached an image, my application is called multiltsp). I'm using ip_queue for this.
OK. So somewhere, there should be a MultiLTSPService which is the thing that gets stopped by these exceptions, I think.
There is a LDAP somewhere that has all client MACs that are in the group (eg. the 150 clients) and from time to time, multiltsp re-reads this list. (I'm simplifying much of these details). I'll call this list "ALL-MACS"... ... all multiltsp daemons MUST have the ALL-MACS list identical, in case there is a out of sync[1] problem the (incorrect) server must quit and the others must handle the clients.
Shouldn't it just get informed that it is in an invalid state, and re-start itself, rather than shutting down entirely? I understand that this is a "panic" state that should "never happen", but you can flush that one bit of state without tanking the entire process.
There are serveral services involved in this application (the multicast UDP protocol, a shell, the ip_queue reader and others), but a major problem as stated above MUST get the application down with some special clean up.
So there needs to be an object that represents the "whole application", which has references to all these services. The reactor should not be serving that purpose.
Glyph, I hope you understand my rustic English in the explanation above. Any advice or suggestion please respond this email.
It's not too bad :)
El Viernes, 1 de Diciembre de 2006 23:11, glyph@divmod.com escribió:
On 30 Nov, 08:00 pm, ncesar@lunix.com.ar wrote: My point is that you are artificially combining your application with your infrastructure. The reactor is always potentially in use by multiple applications, so it is not the thing that should be stopped.
That's new to me! is there any documentation on "multiple applications" reactors?
I have multiple LSTP (Linux Terminal Server Project) servers. All servers are (almost) the same, and any of them can serve any client. There are arround 8-12 servers and 150+ clients. I'm developing a twisted application that balances clients requests (by filtering DHCP discover/requests packets. (I attached an image, my application is called multiltsp). I'm using ip_queue for this.
OK. So somewhere, there should be a MultiLTSPService which is the thing that gets stopped by these exceptions, I think.
I have a t.a.service.MultiService() serving all this inside an t.a.service.Application, where should I write the "try:.. except:" code?
There is a LDAP somewhere that has all client MACs that are in the group (eg. the 150 clients) and from time to time, multiltsp re-reads this list. (I'm simplifying much of these details). I'll call this list "ALL-MACS"... ... all multiltsp daemons MUST have the ALL-MACS list identical, in case there is a out of sync[1] problem the (incorrect) server must quit and the others must handle the clients.
Shouldn't it just get informed that it is in an invalid state, and re-start itself, rather than shutting down entirely?
Rebuilding your house won't stop the hurricane :-) re-starting won't bring it to a correct state, just because it's a problem from outside, usually asociated with a (sysadmin) human action. I need the process to stop (and send some mails) so it can be fully reparied with qualified supra-sysadmins. The MultiLTSP server can't be a zombie forever... But then again, i'm new to twisted (less than 5 month) and probably i'm misunderstanding twisted's components.
So there needs to be an object that represents the "whole application", which has references to all these services. The reactor should not be serving that purpose.
I thought the main quit() was the reactor.stop(), my teachers were tutorials, is there any cleaner way to quit. There is a t.a.service.Application() should be used for this? should be used ANOTHER object? -- Nicolás D. César <ncesar@lunix.com.ar> Lunix S.R.L. -[ http://www.lunix.com.ar ]- GnuPG Public Key: gpg --keyserver wwwkeys.pgp.net --recv-key 0x3606F3E6
participants (2)
-
glyph@divmod.com
-
Nicolas D. Cesar