Skip to content

Commit a84b0f3

Browse files
Fix race-condition with two parallel PURGE (#42)
1 parent 20d341d commit a84b0f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ngx_cache_purge_module.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,9 @@ ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *pa
13371337
file.offset = file.sys_offset = 0;
13381338
file.fd = ngx_open_file(path->data, NGX_FILE_RDONLY, NGX_FILE_OPEN,
13391339
NGX_FILE_DEFAULT_ACCESS);
1340+
if (file.fd == -1) {
1341+
return NGX_OK;
1342+
}
13401343
file.log = ctx->log;
13411344

13421345
/* I don't know if it's a good idea to use the ngx_cycle pool for this,

0 commit comments

Comments
 (0)