tarmac is silent even on surprising results

Bug #552695 reported by Chad Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tarmac
Fix Released
High
Paul Hummer

Bug Description

$ trunk/tarmac-lander --debug desktopcouch

There is one branch in desktopcouch's queue, and this command exits silently. The "--debug" seems to have no effect. There is no indication about what happened and what it considered or declined to consider.

It should emit a warning if there is nothing merged, regardless of "--debug" flag. Failing to land something is an error, the same way failing to "rm" a file because it already doesn't exist is an error.

If run with "--debug", it should emit info about every branch it considers and the results of it.

I looked into this for a few minutes, and at first glance logging appears to be correctly set up. Still, nothing is written.

Related branches

Revision history for this message
Paul Hummer (rockstar) wrote :

I had feeling there were lots of cases like this. It's a big reason that I'm re-writing a lot of the Tarmac stuff for 0.3 - thanks for the report. I'll make sure it's fixed in the next version of Tarmac.

Changed in tarmac:
milestone: none → tarmac-0.3
importance: Undecided → High
status: New → Triaged
status: Triaged → In Progress
assignee: nobody → Paul Hummer (rockstar)
Revision history for this message
James Henstridge (jamesh) wrote :

I was having this problem too, so looked at the code.

There is code to generate log messages, but it never seems to reach the log files or stderr.

Looking at how the logger is set up, this seems to be because you don't set a logging level on the logger itself (only on the handlers attached to the logger). This means you inherit the level of the root logger, which defaults to WARNING. Anything below that level doesn't even get passed to the handlers.

I would expect Tarmac to log everything (or maybe everything except DEBUG level messages) to the log file, and log everything above ERROR to stderr by default. If I pass the --verbose flag, I'd expect more messages to be sent to stderr.

Revision history for this message
Paul Hummer (rockstar) wrote :

James- when you looked at the code, did you look at it recently? I've been redo-ing a lot of the logging in Tarmac 0.3, so it may have changed recently. I know there are still holes, but I think I'm pretty close to getting to them all.

Revision history for this message
Chad Miller (cmiller) wrote :

As a note, if I run tarmac to land code and it decides that what I wanted to do is impossible, the level of the message telling me so should be at least WARNING.

Revision history for this message
James Henstridge (jamesh) wrote :

Paul: I was looking at an old version, but the current setup code seems to have similar problems:

        # XXX: bzrlib.commands.Command must be masking the logger stuff, since
        # I can only get logging output if I set up a logger called 'bzr'
        # instead of 'tarmac'
        # Set up logging.
        self.logger = logging.getLogger('bzr')

The reason you'd be seeing output using the "bzr" logger but not a "tarmac" logger is that bzrlib sets the level on its logger, but tarmac is not doing so. The later code still seems to be setting the log level to DEBUG on handlers that will never see messages of that severity.

Revision history for this message
James Henstridge (jamesh) wrote :

Here's a patch against trunk to fix the logging set up. This causes debug level messages to be logged for me, and changing the log level of stderr_handler allows for messages that go to the log file but not stderr.

Paul Hummer (rockstar)
Changed in tarmac:
status: In Progress → Fix Committed
Paul Hummer (rockstar)
Changed in tarmac:
status: Fix Committed → Fix Released
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.