Script ganeti_masterd :: Class IOServer
[hide private]
[frames] | no frames]

Class IOServer


IO thread class.

This class takes care of initializing the other threads, setting signal handlers (which are processed only in this thread), and doing cleanup at shutdown.

Instance Methods [hide private]
 
__init__(self, address, rqhandler)
IOServer constructor
 
setup_queue(self)
 
process_request(self, request, client_address)
Add task to workerpool to process request.
 
handle_error(self, request, client_address)
Handle an error gracefully.
 
serve_forever(self, signal_handlers=None)
Handle one request at a time until told to quit.
 
server_cleanup(self)
Cleanup the server.

Inherited from SocketServer.TCPServer: close_request, fileno, get_request, server_activate, server_bind, server_close

Inherited from SocketServer.BaseServer: finish_request, handle_request, handle_timeout, shutdown, verify_request

Inherited from SocketServer.BaseServer (private): _handle_request_noblock

Class Variables [hide private]

Inherited from SocketServer.UnixStreamServer: address_family

Inherited from SocketServer.TCPServer: allow_reuse_address, request_queue_size, socket_type

Inherited from SocketServer.BaseServer: timeout

Method Details [hide private]

__init__(self, address, rqhandler)
(Constructor)

 

IOServer constructor

Parameters:
  • address - the address to bind this IOServer to
  • rqhandler - RequestHandler type object
Overrides: SocketServer.BaseServer.__init__

process_request(self, request, client_address)

 

Add task to workerpool to process request.

Overrides: SocketServer.BaseServer.process_request

handle_error(self, request, client_address)

 

Handle an error gracefully. May be overridden.

The default is to print a traceback and continue.

Overrides: SocketServer.BaseServer.handle_error
(inherited documentation)

serve_forever(self, signal_handlers=None)

 

Handle one request at a time until told to quit.

Decorators:
  • @utils.SignalHandled([signal.SIGINT, signal.SIGTERM])
Overrides: SocketServer.BaseServer.serve_forever

server_cleanup(self)

 

Cleanup the server.

This involves shutting down the processor threads and the master socket.