Bug 749551 - try except handling in wrong place for beaker-watchdog
Summary: try except handling in wrong place for beaker-watchdog
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Beaker
Classification: Retired
Component: lab controller
Version: 0.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Coghlan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-27 13:41 UTC by Bill Peck
Modified: 2012-10-25 04:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-25 04:46:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill Peck 2011-10-27 13:41:18 UTC
Description of problem:

The try: except: handling in beaker-watchdog will not prevent a failed login from crashing the whole service.

Version-Release number of selected component (if applicable):
0.7.03
0.8.0

How reproducible:
cause a login to fail and beaker-watchdog will exit after it sleeps 20 seconds

Comment 1 Raymond Mancy 2011-10-28 00:37:55 UTC
Do you mean to say that you want the login error caught and then the program exit nicely, as there is not point for the process to be still running if we can't authenticate. That is to say we should have a nicer exit, but we should still exit.

Comment 2 Bill Peck 2011-10-28 00:42:08 UTC
(In reply to comment #1)
> Do you mean to say that you want the login error caught and then the program
> exit nicely, as there is not point for the process to be still running if we
> can't authenticate. That is to say we should have a nicer exit, but we should
> still exit.

The patch I proposed will keep trying for the xmlrpc version.  It does not deal with the qpid version, Thats where I needed your expertise.

Comment 3 Raymond Mancy 2011-10-28 00:56:33 UTC
Why do we keep trying though?
Perhaps it does more harm then good. Imagine that there's a problem where we can see on the server that the watchdog doesn't seem to be updating properly, an admin goes onto beaker-watchdog and immediately sees that the process is dead, so they know that the beaker-watchdog process is the problem. They could then check the log and see that the Login failed. Otherwise they would check and see that the process is running, and possibly dismiss it as the cause of any problem (although they could always check the logs, but they may not think to)

I can see a point in perhaps retrying if it can't make the connection (i.e perhaps the server has temporarily gone away, but will be up in a moment), but if the login fails because the labcontroller.cfg has the wrong user/pass it's not going to fix itself by bombarding the server with doomed login attempts.

Comment 4 Bill Peck 2011-10-28 01:04:25 UTC
So can we distinguish between a invalid login as opposed to a 500 ISE?

Comment 5 Raymond Mancy 2011-10-28 01:41:17 UTC
No, it seems that kobo won't pass on login errors.

Comment 6 Bill Peck 2011-10-28 12:20:11 UTC
I agree with Dan's assessment here:

<dcallagh_work> imho the best behaviour for a daemon is to either refuse to start, or run forever

Lets do an initial login before we daemonize and exit non-zero if we can't login.

The outstanding issue is how to deal with re-login for the qpid routine..

Comment 7 Raymond Mancy 2011-10-30 23:39:30 UTC
Seeing as the the nature of watchdog via qpid is not to loop, we should perhaps add a seperate thread to handle a periodic session renewal.
I'll add to the existing patch today

Comment 8 Nick Coghlan 2012-10-17 04:39:10 UTC
Bulk reassignment of issues as Bill has moved to another team.

Comment 9 Dan Callaghan 2012-10-25 04:46:45 UTC
Qpid-related stuff no longer applies. And I already wrote a patch to make the lab controller daemons log in before daemonising, but due to kobo bug 753006 it doesn't work anyway.

So I'm closing this since I don't think there is anything else we can do here.


Note You need to log in before you can comment on or make changes to this bug.