Merge lp:~yavor-nikolov/pbzip2/bug-762464-consumer_decompress-hang-on-trailing-garbage-and-empty-queue into lp:pbzip2/1.1

Proposed by Yavor Nikolov on 2011-04-16
Status: Merged
Merged at revision: 20
Proposed branch: lp:~yavor-nikolov/pbzip2/bug-762464-consumer_decompress-hang-on-trailing-garbage-and-empty-queue
Merge into: lp:pbzip2/1.1
Diff against target: 50 lines (+10/-1)
2 files modified
ChangeLog (+2/-0)
pbzip2.cpp (+8/-1)
To merge this branch: bzr merge lp:~yavor-nikolov/pbzip2/bug-762464-consumer_decompress-hang-on-trailing-garbage-and-empty-queue
Reviewer Review Type Date Requested Status
Yavor Nikolov Approve on 2011-04-16
Review via email: mp+57994@code.launchpad.net

Description of the change

Fix of bug #762464 (hang on trailing garbage with relatively large -p#: consumers waiting for new blocks are waiting forever on empty queue when producer has been interrupted due to trailing garbage)

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-04-01 20:13:21 +0000
3+++ ChangeLog 2011-04-16 13:01:14 +0000
4@@ -1,4 +1,6 @@
5 Changes in 1.1.4 (NOT RELEASED YET)
6+- Fixed hang on decompress with --ignore-trailing-garbage=1 when
7+ producer is interrupted on trailing garbage (bug #762464)
8 - Added example to help for decompression piped to tar (bug #746806)
9 - Fixed typo in Trailing Garbage printed message (bug #746799)
10 Changes in 1.1.3 (Mar 27, 2011)
11
12=== modified file 'pbzip2.cpp'
13--- pbzip2.cpp 2011-04-01 20:13:21 +0000
14+++ pbzip2.cpp 2011-04-16 13:01:14 +0000
15@@ -192,6 +192,8 @@
16 * - Default extension on decompress of .tbz2 changed to .tar for
17 * bzip2 compatibility (bug #743639)
18 * - Print trailing garbage errors even when in quiet mode (bug #743635)
19+ * - Fixed hang on decompress with --ignore-trailing-garbage=1 when
20+ * producer is interrupted on trailing garbage (bug #762464)
21 *
22 *
23 * Specials thanks for suggestions and testing: Phillippe Welsh,
24@@ -1247,6 +1249,8 @@
25
26 if (producerDecompressCheckInterrupt(hInfile, fileData, NumBlocks) != 0)
27 {
28+ safe_cond_broadcast(fifo->notEmpty); // just in case
29+ syncSetProducerDone(1);
30 return 0;
31 }
32
33@@ -1272,6 +1276,8 @@
34
35 if (producerDecompressCheckInterrupt(hInfile, fileData, NumBlocks) != 0)
36 {
37+ safe_cond_broadcast(fifo->notEmpty); // just in case
38+ syncSetProducerDone(1);
39 safe_mutex_unlock(fifo->mut);
40 return 0;
41 }
42@@ -1344,7 +1350,8 @@
43 #endif
44 }
45 if ( (syncGetLastGoodBlock() != -1) &&
46- ( (lastElement == NULL) || (lastElement->blockNumber > syncGetLastGoodBlock()) ) )
47+ ( (lastElement == NULL) || (lastElement->blockNumber > syncGetLastGoodBlock())
48+ || lastElement->isLastInSequence ) )
49 {
50 isInterrupted = true;
51

Subscribers

People subscribed via source and target branches