Bug 12195 - Scanning hangs on file that can't be read
: Scanning hangs on file that can't be read
Status: RESOLVED INVALID
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.3.2
: PC Other
: -- normal (vote)
: Investigating
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-28 17:36 UTC by Forest Bond
Modified: 2009-10-30 15:27 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Forest Bond 2009-05-28 17:36:46 UTC
Hi,

There is a bug in the AFP implementation on my NAS box that revealed a bug in the SqueezeCenter scanner.  The scanner was scanning files on an AFP share, and the AFP bug resulted in a file that appears visible in the readdir result, can be stat'ed, but then returns "no such file or directory" when it is opened.  This causes the scanner to hang indefinitely.

While there is a bug in AFP that caused this, I wondered if removing a file while the scanner is running could cause the same problem, as there is a potential race condition if the file is unlinked between readdir and open calls.  This is hard to replicate without the AFP bug.

For what it's worth.

Thanks,
Forest
Comment 1 James Richardson 2009-05-29 13:01:34 UTC
Forest: can you please attach the file that is causing the hang to this bug report?
Comment 2 Forest Bond 2009-05-29 13:17:52 UTC
Hi,

Attaching the file wouldn't be helpful.  Like I said, the problem is that the filesystem was not behaving normally:

 * readdir returned the filename in the directory listing
 * stat was successful
 * open failed with "no such file or directory"

The only reason I filed a bug here is because the same symptom could potentially be caused on a correctly functioning filesystem by removing a file between the readdir and open calls.  (Actually, it would be slightly different because subsequent readdir calls would no longer include the file.)  It's possible that the scanner actually handles this situation correctly; verifying would be difficult because you would have to simulate the race condition somehow.

This may also be useful: I believe that removing the file "unstuck" the scanner.  It was probably repeatedly trying to open the file, and repeatedly failing.
Comment 3 James Richardson 2009-06-08 13:48:18 UTC
Can you give us details on your hardware, we need to be able to reproduce the issue here, to figure it out a proper fix.
Comment 4 James Richardson 2009-10-30 15:27:10 UTC
No further information, no bug to fix, closing bug