Bug 969845

Summary: upload to a directory occasionally hangs instead of failing
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, mbooth, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-02 18:16:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
upload-test.pl
none
Log with LIBGUESTFS_TRACE=1 LIBGUESTFS_DEBUG=1 none

Description Richard W.M. Jones 2013-06-02 16:59:24 UTC
Created attachment 756038 [details]
upload-test.pl

Description of problem:

See attached test script.  This test script creates a directory
and then uploads a file to this directory (to the directory itself,
not inside the directory).  Obviously this should fail since
you can't upload to a directory.  And usually it does fail.  However
once in a while (very rarely) it hangs.

Version-Release number of selected component (if applicable):

libguestfs 1.23.1

How reproducible:

100% reproducible using the test script, although the actual
failure is very rare.

Steps to Reproduce:
1. Run attached test script.
2. Observe that after a while the spinner will hang.
3. Rerun with LIBGUESTFS_DEBUG=1 to get more detail.

Actual results:

Hangs.  During the hang, no %CPU is used and there is no output.

Expected results:

Should run forever.

Comment 1 Richard W.M. Jones 2013-06-02 17:03:23 UTC
Created attachment 756042 [details]
Log with LIBGUESTFS_TRACE=1 LIBGUESTFS_DEBUG=1

This is a log when running upload-test.pl with both trace and
debug enabled.

Also I am running:
kernel-3.9.4-200.fc18.x86_64
libvirt-daemon-1.0.5.1-1.fc20.x86_64
qemu-1.5.0-1.fc18.x86_64 [self-compiled from Rawhide]

Comment 2 Richard W.M. Jones 2013-06-02 17:29:49 UTC
Also happens with upstream qemu from git (fixed because there's
currently an unrelated bug in qemu).

Also happens with qemu 1.5.0-4 [self-compiled from Rawhide]

Comment 3 Richard W.M. Jones 2013-06-02 17:34:12 UTC
Does not happen with $g->upload is replaced by $g->write,
indicating this is probably a protocol synchronization error
related to FileIn & error handling.

Comment 4 Richard W.M. Jones 2013-06-02 18:16:37 UTC
Fixed upstream in commit 697b0f89fed04a4017e033861a9eaaa40b3270d9.