Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: save tags when using chunk/stream #4920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acha-bill
Copy link
Contributor

@acha-bill acha-bill commented Dec 4, 2024

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Do not use HTTP request context so that tags will be saved when putter.Done is called after the HTTP connection is upgraded to websocket.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

closes #4858

Screenshots (if appropriate):

@@ -56,7 +56,7 @@ func (s *Service) chunkUploadStreamHandler(w http.ResponseWriter, r *http.Reques
}

// if tag not specified use direct upload
putter, err := s.newStamperPutter(r.Context(), putterOptions{
putter, err := s.newStamperPutter(context.Background(), putterOptions{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is context.Background() better here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably because the go routine below handles the websocket connection but since this function returns, the context is canceled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@acha-bill acha-bill requested a review from martinconic December 9, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chunks uploaded with websocket are not counted into tag stats
3 participants