epugh opened a new pull request, #4367:
URL: https://github.com/apache/solr/pull/4367

   I disocvered this issue while working on 
https://github.com/apache/solr/pull/4249 (SOLR-16341: fix blank file zip 
handling).
   
   ClusterFileStore.getMetadata could return a 500 when a file was deleted 
between fileStore.list(...) returning the entry and convertToResponse calling 
FileDetails.size()/getTimeStamp() on it. The underlying 
Files.size()/Files.getLastModifiedTime() would throw NoSuchFileException, which 
DistribFileStore wrapped as SolrException(SERVER_ERROR).
   
   Reproducible via beasting TestDistribFileStore.testFileStoreManagement (seen 
~1/20 with seed 30453DE51CF44AB7, US-ASCII, security manager).
   
   Fix:
   - DistribFileStore.FileInfo: catch NoSuchFileException in size() (returns 
-1) and getTimeStamp() (returns null) so callers can distinguish a 
concurrent-delete race from a real I/O failure.
   - ClusterFileStore.convertToResponse: returns null when size() < 0, 
signalling the entry vanished mid-call.
   - ClusterFileStore.getMetadata: filters null entries from the DIRECTORY 
listing; the FILE/METADATA branch already maps an empty result to null, which 
now also covers the race case so the response matches NOFILE semantics 
(singletonMap(path, null)).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to