Patch: Prevent crit error being loggged on delete of non-existent file

Maxim Dounin mdounin at
Tue Nov 19 22:42:52 UTC 2013


On Tue, Nov 19, 2013 at 05:36:51PM -0000, Steven Hartland wrote:

> >On Tue, Nov 19, 2013 at 04:43:54PM -0000, Steven Hartland wrote:
> >
> >>Hi guys the attached patch prevents http file cache from
> >>logging a critical error when a file delete fails due to
> >>it not existing, which I'm sure was never the intention.
> >
> >Why you think it's not an intention?  If a file doesn't exists but
> >nginx tries to delete it - it means that nginx has wong notion of
> >what is on disk.  It's certainly a problem which deserves logging.
> I can understand that being an issue when you tried to access
> the file from the cache, but thats not where it gets logged
> only on delete and as your deleting it why worry if its not
> there?

Because it's not what nginx expects.  This indicate a problem - 
either a bug in nginx, or some external modification of a cache 

> In specific use case here is a manual cache purge which has occured
> deleting all files in the directory, which admittely isnt ideal,
> but appart from the critical error being logged on delete
> everything appears to be working fine.

While manual deleting of cache files is generally considered safe, 
it implies at least one problem - the cache manager can't maintain 
max_size correctly if some files were deleted.

If you've modified the cache manually, it's expected that you 
know what you are doing, and agree with implications.  But it's up 
to you to ensure everything is working fine, and it's up to nginx 
to complain about inconsistencies it detected.

Maxim Dounin

More information about the nginx-devel mailing list