[squid-dev] [RFC] on_crash

Alex Rousskov rousskov at measurement-factory.com
Wed Dec 9 17:51:43 UTC 2015


On 12/09/2015 10:29 AM, Kinkie wrote:

>   this sounds like an useful feature, especially if we also manage to
> include a sample/default crash handler.

A sample sounds good (the script I posted can be a good starting point
though it is far from perfect). There should probably be no default
script because crash handling needs vary a lot and because there are
probably security implications related to one.


> Among the choices you provide I like "on_fatal_exit"; 

I am curious why you think on_crash is worse than on_fatal_exit?


> I could also
> suggest "crash_handler", "crash_helper", "crash_report_collector" or
> somesuch.

IMO, we should use the "on_" prefix because it allows us to group many
simple options related to crash handling instead of focusing on the
handler alone (see my original post for examples). It is also a familiar
prefix for all sorts of event handlers.


Thank you,

Alex.


> Good thinking
> 
> On Wed, Dec 9, 2015 at 5:51 PM, Alex Rousskov
> <rousskov at measurement-factory.com> wrote:
>> Hello,
>>
>>     The attached patch modifies Squid to run /tmp/squid-on-fatal.sh on
>> fatal errors. A sample script is also attached. I needed this trick to
>> triage a complicated bug related to Squid shared memory usage.
>>
>> In general, running such a script helps record the environment state
>> _before_ Squid exits, which is important when the problem is related to
>> Squid resource usage that often becomes invisible after the Squid
>> process is gone: connections, FDs, shared memory segments, etc.
>>
>> The patch needs more work to make this behavior and the script name
>> squid.conf-configurable. We should also pass Squid PID and Squid process
>> "role" to the script as parameters so that the script does not have to
>> guess them.
>>
>>
>> Do you want this feature in Squid?
>>
>> If yes, which squid.conf directive name do you think works the best?
>> Here are some options to consider:
>>
>> on_crash ...
>> on_fatal_exit ..
>> on_bad_exit ...
>> on_unexpected_exit ...
>> on_exit <success|failure> ...
>>
>> The directive parameter could be
>>
>>   program=...
>>   handler=...
>>
>> which would allow us to easily add more exit-handling options later if
>> needed (e.g., free_all_memory, keep_shared_memory, etc.).
>>
>>
>> Please note that Squid already does something similar on startup. See
>> squid_start_script in main.cc. That hack should be made configurable
>> too, of course (on_start, on_launch, etc.).
>>
>>
>> Thank you,
>>
>> Alex.
>>
>> _______________________________________________
>> squid-dev mailing list
>> squid-dev at lists.squid-cache.org
>> http://lists.squid-cache.org/listinfo/squid-dev
>>
> 
> 
> 



More information about the squid-dev mailing list