ValueError: need more than 3 values to unpack on HashQueueTests.test_called_back_error

Bug #911296 reported by Natalia Bidart
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Won't Fix
Medium
Alejandro J. Cura

Bug Description

Trace is:

  HashQueueTests
    test_being_hashed ... [OK]
    test_called_back_error ... Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/home/nessita/canonical/client/trunk/ubuntuone/syncdaemon/hash_queue.py", line 125, in run
    hashdata, crc, size, stat = result
ValueError: need more than 3 values to unpack

                                            [OK]

The test pass the same since the error happens inside a thread.

Changed in ubuntuone-client:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Alejandro J. Cura (alecu)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

I'm unable to reproduce this issue, so it's probably fixed by now.

Changed in ubuntuone-client:
status: Triaged → Invalid
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Hola alecu,

this is still an issue in my env, very likely a timing issue.

Changed in ubuntuone-client:
status: Invalid → Triaged
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Applying a dummy patch that will have a try-except around the hashdata, crc, size, stat = result code:

=== modified file 'ubuntuone/syncdaemon/hash_queue.py'
--- ubuntuone/syncdaemon/hash_queue.py 2011-10-14 20:02:23 +0000
+++ ubuntuone/syncdaemon/hash_queue.py 2012-03-23 20:43:33 +0000
@@ -122,7 +122,11 @@
             except StopHashing, e:
                 self.logger.debug(str(e))
             else:
- hashdata, crc, size, stat = result
+ try:
+ hashdata, crc, size, stat = result
+ except:
+ print '\n\n\n\n======= RESULT', repr(result)
+ raise
                 self.logger.debug("Hasher: path hash pushed: path=%r hash=%s"
                                   " crc=%s size=%d st_ino=%d st_size=%d"
                                   " st_mtime=%r", path, hashdata, crc, size,

Running that in an infinite loop, I got this:

  HashQueueTests
    test_being_hashed ...

======= RESULT 'foo'
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/home/nessita/canonical/client/trunk/ubuntuone/syncdaemon/hash_queue.py", line 126, in run
    hashdata, crc, size, stat = result
ValueError: need more than 3 values to unpack

                                                 [OK]
    test_called_back_error ... [OK]

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

I guess I found the problem: if you open test_hashqueue.py, you will find this piece:

    588 original_hash = hash_queue._Hasher._hash
    589
    590 def f(*a):
    591 """Fake _hash."""
    592 event.wait()
    593 return "foo"
    594 hash_queue._Hasher._hash = f

    588 original_hash = hash_queue._Hasher._hash
    589
    590 def f(*a):
    591 """Fake _hash."""
    592 event.wait()
    593 return "foo"
    594 hash_queue._Hasher._hash = f

(in several places, could please improve all of them?)

Changed in ubuntuone-client:
status: Triaged → Won't Fix
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.