Skip to content

Commit

Permalink
Fix race-condition with two parallel PURGE (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoHeichou authored Feb 22, 2023
1 parent 20d341d commit a84b0f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ngx_cache_purge_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,9 @@ ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *pa
file.offset = file.sys_offset = 0;
file.fd = ngx_open_file(path->data, NGX_FILE_RDONLY, NGX_FILE_OPEN,
NGX_FILE_DEFAULT_ACCESS);
if (file.fd == -1) {
return NGX_OK;
}
file.log = ctx->log;

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

0 comments on commit a84b0f3

Please sign in to comment.