Bug #30387 Proxy should let Lua scripts handle OS events
Submitted: 13 Aug 2007 12:57
Reporter: Giuseppe Maxia Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Proxy: Core Severity:S4 (Feature request)
Version:0.6.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: events, proxy

[13 Aug 2007 12:57] Giuseppe Maxia
Description:
Currently, there is no way for a Lua script to handle termination  events.
This handling is needed to clean up after complex tasks, or to summarize actions that occurred during the proxy lifetime.

The main events that should have a handle are:

- quit (Normal exit)
- termination (user interrupt)
- kill (caught SIGTERM)

How to repeat:
try to detect when the Proxy is exiting.

Suggested fix:

Create a handler for all termination events in the proxy, and expose such handler in the API, so that it can be used from a Lua script.

One possible implementation would be to have just one function (e.g. signal_handler(signal_object)) to catch all events.