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

Uniform Termination Process for Store Implementations: Ensuring Consistent Removal of Binary and .info Files #1075

Open
DarioCalovic opened this issue Jan 28, 2024 · 1 comment · May be fixed by #1082
Labels

Comments

@DarioCalovic
Copy link

Describe the bug
Issueing the termination process the filestore removes both the binary as well as the .info file. The gcc store only removes the binary file.

To Reproduce
The .info is being ignored explicit: https://github.com/tus/tusd/blob/main/pkg/gcsstore/gcsservice.go#L355

func (service *GCSService) FilterObjects(ctx context.Context, params GCSFilterParams) ([]string, error) {

# ...

  if strings.HasSuffix(objAttrs.Name, "info") {
    continue
  }

# ...


Expected behavior
The expected behavior is that all store implementations, including the GCS store, should uniformly handle the terminating process by removing both the binary files and their corresponding .info files. The termination process should be consistent across different store implementations to ensure a standardized and predictable behavior.

@Acconut
Copy link
Member

Acconut commented Jan 29, 2024

Good catch! FilterObjects has been designed to find objects in a bucket which should be composed to form the final object. The .info should not be included here and is thus explicitly removed from the list. For terminating the upload, this behavior is not wanted, as you correctly found.

A solution would be to add an object IncludeInfoObject to GCSFilterParams, which can be set by the termination code to instruct FilterObjects to not exclude .info objects. Would you be interested in opening a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants