go-nfs
go-nfs copied to clipboard
onReadDirPlus with small cache yields no results, but no error
The readme contains this code:
cacheHelper := nfshelper.NewCachingHandler(handler, 1)
However, this will cause an error like this:
[WARN] Caching handler created with insufficient cache to support directory listing%!(EXTRA string=size, int=1, string=verifiers, int=1)
Ignoring the malformed fmt string, this error makes sense because you need at least two entries for . and .. in a directory. However, if you bump the cache size from 1 to 2, you get empty output for all directories. All other usages of NewCachingHandler appear to specify 1024, and indeed, if you specify that, directory listing works... up to 1024 entries. Pagination still appears broken.
It seems that the started and obj.Cookie handling logic in onReadDirPlus is incorrect, but I haven't fully debugged it yet.
this should be better with #118 - it changes the default caching handler to re-use/have more stable handle behavior, which seems needed in many cases.
@brandonbloom can you check if the master / head of this repo now has reasonable behavior / does not cause the error you saw previously?