Skip to content

Commit

Permalink
Fix so that resolve timeout does not cancel mirroring attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba committed May 16, 2024
1 parent 0a90881 commit 16e7a78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#460](https://github.com/spegel-org/spegel/pull/460) Fix environment variable for http-bootstrap-addr flag.
- [#471](https://github.com/spegel-org/spegel/pull/471) Fix handler key in request logging.
- [#491](https://github.com/spegel-org/spegel/pull/491) Fix so that resolve timeout does not cancel mirroring attempts.

### Security

Expand Down
3 changes: 1 addition & 2 deletions pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ func (r *Registry) handleMirror(rw mux.ResponseWriter, req *http.Request, ref re
mirrorAttempts := 0
for {
select {
// TODO: Refactor context cancel and mirror channel closing
case <-resolveCtx.Done():
case <-req.Context().Done():
// Request has been closed by server or client. No use continuing.
rw.WriteError(http.StatusNotFound, fmt.Errorf("mirroring for image component %s has been cancelled: %w", key, resolveCtx.Err()))
return
Expand Down

0 comments on commit 16e7a78

Please sign in to comment.