Skip to content

Conversation

Werberus
Copy link
Contributor

What problem are we solving?

#6787

How are we solving the problem?

These improvements add context to filer_client methods calls. This will allow you to pass the request_id from external calls, such as minio-gateway and others. Internal method calls are closed by context.Background.

PR affects a large number of files due to the large number of dependencies in method calls.

Next, you will need to add the missing contexts to the filer server methods.

How is the PR tested?

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

@chrislusf chrislusf requested a review from Copilot May 22, 2025 16:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds context propagation to filer_client method calls across multiple files, enabling the passing of request_id from external calls while isolating internal invocations with context.Background().

  • Updated function signatures of filer_client methods to accept a context parameter.
  • Replaced direct calls without context with context.Background() where applicable.
  • Propagated context through various file operations across the codebase.

Reviewed Changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated no comments.

Show a summary per file
File Description
weed/pb/filer_pb/filer_client_bfs.go Added context.Background() to ReadDirAllEntries call.
weed/pb/filer_pb/filer_client.go Updated several methods to accept context and propagate it.
weed/mq/logstore/read_parquet_to_log.go Updated the call to SeaweedList with context.Background().
weed/mq/logstore/read_log_from_disk.go Updated the call to SeaweedList with context.Background().
weed/mq/logstore/log_to_parquet.go Updated multiple calls (CreateEntry, ReadDirAllEntries) with context.
weed/mq/broker/broker_write.go Updated GetEntry and CreateEntry calls with context.Background().
weed/mount/weedfs_symlink.go Updated CreateEntry call with context.Background().
weed/mount/weedfs_link.go Updated UpdateEntry and CreateEntry calls with context.Background().
weed/mount/weedfs_file_sync.go Updated CreateEntry call with context.Background() in flush.
weed/mount/weedfs_file_mkrm.go Updated CreateEntry and Remove calls with context.Background().
weed/mount/weedfs_dir_mkrm.go Updated CreateEntry and Remove calls with context.Background().
weed/mount/weedfs_dir_lookup.go Updated GetEntry call with context.Background().
weed/mount/meta_cache/meta_cache_init.go Updated ReadDirAllEntries call with context.Background().
weed/filer/read_write.go Updated LookupEntry, CreateEntry, UpdateEntry calls with context.Background().
weed/command/mount_std.go Updated Mkdir call with context.Background().
weed/command/filer_remote_sync_dir.go Updated GetEntry call with context.Background().
weed/command/filer_remote_gateway_buckets.go Updated List call with context.Background().
weed/command/filer_copy.go Updated CreateEntry calls with context.Background().
weed/command/filer_cat.go Updated LookupEntry call with context.Background().
unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go Updated CreateEntry call with context.Background().

@chrislusf chrislusf merged commit 165af32 into seaweedfs:master May 22, 2025
7 checks passed
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.

2 participants