-Dbytes not seeing total bytes transferred

Bug #713258 reported by John A Meinel
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
John A Meinel

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't know what we broke in the tracking data-transferred case, but I
was just doing some testing with:

 bzr branch -Dbytes bzr+ssh://localhost/.... local

And it didn't report the number of bytes transferred. Checking in
~/.bzr.log shows that it thought there were 0 bytes transferred, which
is when it suppresses the message (though it shouldn't if you are
passing -Dbytes directly.)

I tested the same command with bzr 2.2.2 and the bytes transferred were
tracked correctly (as near as I could tell).

While the content is being transferred, it does seem to be aggregating
the number of bytes. So something between the active transport
transferring data, and the final logging of it has been broken.

I did some manual stepping back through old tags, and this broke between
bzr-2.3b1 and bzr-2.3b2.

I haven't been able to figure out what, exactly, is going on. But it
looks like the object that is getting 'report_transport_activity()'
calls, is *not* the same object that is getting
'log_transport_activity()' calls.

I wonder if this is the initialize() code screwing with state?

 affects bzr
 status confirmed
 importance critical
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1MQvEACgkQJdeBCYSNAAPh3QCgrJQaGgAv/zQlUnMyusklHqs2
JoAAoNOXG4MqLhkKx0vpAxFFb1ARg3BE
=M2d4
-----END PGP SIGNATURE-----

Related branches

Revision history for this message
John A Meinel (jameinel) wrote :

Some debugging. Inside the main() function in bzrlib/commands.py is where we are doing the logging. At the point where we are ready to run the command:

 ret = run_bzr_catch_errors(argv)
 (pdb) bzrlib.ui.ui_factory._progress_view
 <bzrlib.ui.text.TextProgressView object at 0x9ac42cc>

At the point where we are ready to print

 bzrlib.ui.ui_factory.log_transport_activity(...)
 (pdb) bzrlib.ui.ui_factory._progress_view
 <bzrlib.ui.text.TextProgressView object at 0xa003f4c>

So something between when we start and when we finish is changing the _progress_view object. Note that I checked and the ui_factory object itself has not changed.

Revision history for this message
John A Meinel (jameinel) wrote :

Found it in bzrlib.commands.py:

        try:
            return self.run(**all_cmd_args)
        finally:
            # reset it, so that other commands run in the same process won't
            # inherit state
            trace.set_verbosity_level(0)

That final set_verbosity_level(0) resets the _progress_view state, and it happens *before* we fall all the way back out to main() to decide that we want to log how many bytes are transferred.

Revision history for this message
John A Meinel (jameinel) wrote :

I have the fix written, and it should hit 2.3.1, I won't worry too much about Critical status.

Changed in bzr:
assignee: nobody → John A Meinel (jameinel)
importance: Critical → High
milestone: none → 2.3.1
status: Confirmed → In Progress
John A Meinel (jameinel)
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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