Skip to content

fix(connect): do not print stack when s3 error#3155

Merged
woshigaopp merged 3 commits into
1.6from
feature/modify_s3_log_stack_connect
Jan 16, 2026
Merged

fix(connect): do not print stack when s3 error#3155
woshigaopp merged 3 commits into
1.6from
feature/modify_s3_log_stack_connect

Conversation

@woshigaopp
Copy link
Copy Markdown
Contributor

This pull request introduces a new mechanism to check S3 readiness before initializing key AutoMQ components that rely on object storage, such as the S3 log uploader and the AutoMQ telemetry exporter. The main changes include the addition of the S3PermissionProbe utility, its integration into the CLI startup flow, and corresponding unit tests to ensure correct behavior.

S3 readiness and initialization improvements:

  • Added a new utility class S3PermissionProbe that centralizes logic for probing S3 bucket readiness for both log uploading and metrics exporting. It checks configuration, validates bucket access, and reports whether initialization should proceed.
  • Updated AbstractConnectCli to use S3PermissionProbe before initializing the S3 log uploader and AutoMQ telemetry exporter, ensuring these components only start if S3 is ready and logging a warning if not. [1] [2]

Testing enhancements:

  • Added a comprehensive test class S3PermissionProbeTest to verify correct behavior for various configuration scenarios, including missing buckets, readiness failures, and non-S3 exporters.

Copilot AI review requested due to automatic review settings January 15, 2026 10:29
Copy link
Copy Markdown
Contributor

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 S3 readiness checking before initializing AutoMQ components that depend on object storage, preventing unnecessary stack traces when S3 is unavailable or misconfigured. The main addition is the S3PermissionProbe utility class that validates S3 bucket access before initialization.

Changes:

  • Added S3PermissionProbe utility class to check S3 bucket readiness and configuration validity
  • Modified AbstractConnectCli to conditionally initialize S3 log uploader and telemetry exporter based on probe results
  • Added comprehensive unit tests for various S3 configuration scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
connect/runtime/src/main/java/org/apache/kafka/connect/automq/s3/S3PermissionProbe.java New utility class that probes S3 bucket readiness for log uploading and metrics exporting
connect/runtime/src/main/java/org/apache/kafka/connect/cli/AbstractConnectCli.java Updated to use S3PermissionProbe before initializing S3-dependent components
connect/runtime/src/test/java/org/apache/kafka/connect/automq/s3/S3PermissionProbeTest.java Comprehensive test suite covering configuration scenarios and readiness failures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

superhx
superhx previously approved these changes Jan 15, 2026
@woshigaopp woshigaopp merged commit 3c3ace4 into 1.6 Jan 16, 2026
6 checks passed
@woshigaopp woshigaopp deleted the feature/modify_s3_log_stack_connect branch January 16, 2026 06:34
woshigaopp added a commit that referenced this pull request Jan 16, 2026
fix(connect): do not print stack when s3 error
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.

3 participants