Bug #2729

Race condition in hash calculation in downloader.sh

Added by Jaime Melis over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:02/13/2014
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - Storage
Target version:Release 4.6
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.4

Description

This statement runs the hasher in a subshell:

$command | tee >( decompress "$decompressor" "$TO" ) \
    >( hasher $HASH_TYPE ) >/dev/null

However, it may happen that the hasher has not yet finished writing the hash value to a file when this instruction is executed:

HASH_RESULT=$( cat $HASH_FILE)

A workaround would be to poll the existance of the file before doing the cat.


Related issues

Related to Bug #2499: marketplace download error Closed 11/26/2013
Related to Bug #2629: md5 mismatch when uploading a file to Sunstone through a ... Closed 01/13/2014

Associated revisions

Revision e18be2d5
Added by Jaime Melis over 6 years ago

Bug #2729: Race condition in hash calculation in downloader.sh

Revision d44e5be3
Added by Jaime Melis over 6 years ago

Bug #2729: Fix the race condition for stdout destinations as well as
as file destinations

History

#1 Updated by Javi Fontan over 6 years ago

  • Related to Bug #2499: marketplace download error added

#2 Updated by Jaime Melis over 6 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

#3 Updated by Javi Fontan over 6 years ago

  • Assignee changed from Javi Fontan to Jaime Melis

#4 Updated by Jaime Melis over 6 years ago

  • Related to Bug #2629: md5 mismatch when uploading a file to Sunstone through a proxy server added

Also available in: Atom PDF