Hooks need to have an enforceable timeout.

Bug #705433 reported by Kapil Thangavelu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pyjuju
Triaged
Low
Unassigned

Bug Description

Currently a hook execution can take an arbitrary amount of time. We should have an enforceable timeout configured for hook execution.

Tags: hooks
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

at a minimum this should expose a timeout when the hook cli api tries to connect to the api server, which will at least error out and clean up those processes, else they just remain waiting on socket.connect forever if the api server is not around.

Changed in ensemble:
importance: Undecided → Medium
Changed in ensemble:
milestone: none → capetown
tags: added: hooks
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

This needs to be compatible with the interactive hook debug.. i think a minimum for correct behavior here, is to have timeouts on hook cli api connecting to the hook api server, as in my experience that's what causes indefinite hangs from hooks.

Changed in ensemble:
milestone: capetown → budapest
Changed in ensemble:
milestone: budapest → dublin
Changed in ensemble:
assignee: nobody → Kapil Thangavelu (hazmat)
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

we also have to be careful with particular hooks like upgrade which might take a long time.

Changed in ensemble:
assignee: Kapil Thangavelu (hazmat) → nobody
Changed in ensemble:
milestone: dublin → none
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

In a discussion on IRC, I recall that we came up with a good idea here. The hooks should be sent SIGUSR1 first. If they have a handler for SIGUSR1, they can choose to defer the timeout with a hook executable, something like 'hook-control defer-timeout'. This way hooks that are expected to take a really long time can write handlers and defer. If they do not respond to the SIGUSR1 within X seconds, then SIGTERM and SIGKILL will be used, and errors raised.

I'm going to mark this as Confirmed. I've had a few misbehaving hooks now that locked everything up.

Changed in juju:
status: New → Confirmed
Curtis Hovey (sinzui)
Changed in juju:
status: Confirmed → Triaged
Curtis Hovey (sinzui)
Changed in juju:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.