-
Notifications
You must be signed in to change notification settings - Fork 2k
[Bug][Zeta] SeaTunnelClient can not exit with error #9281
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 fixes a bug where SeaTunnel components do not exit with an error by adding explicit error handling with System.exit(1) on fatal errors during Hazelcast initialization. Key changes include modifications in the server starter, Hazelcast client, and client command components to catch Errors and call System.exit(1).
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServerStarter.java | Added try-catch block around Hazelcast initialization to log and exit on fatal errors. |
seatunnel-engine/seatunnel-engine-client/src/main/java/org/apache/seatunnel/engine/client/SeaTunnelHazelcastClient.java | Updated the constructor to catch Errors during client initialization and exit with an error code. |
seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java | Wrapped Hazelcast instance creation in a try-catch block to handle fatal errors and exit properly. |
Files not reviewed (1)
- pom.xml: Language not supported
} catch (Error e) { | ||
log.error("Fatal error occurred during Hazelcast server initialization", e); | ||
System.exit(1); | ||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] After calling System.exit(1), rethrowing the error is redundant since the JVM will terminate. Consider removing the rethrow for clarity unless it is required for testing purposes.
throw e; |
Copilot uses AI. Check for mistakes.
} catch (Error e) { | ||
log.error("Fatal error occurred during Hazelcast client initialization", e); | ||
System.exit(1); | ||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The rethrow after System.exit(1) is generally unnecessary since the process will terminate. Consider removing or documenting this pattern if it serves a specific testing purpose.
throw e; |
Copilot uses AI. Check for mistakes.
} catch (Error e) { | ||
log.error("Fatal error occurred during Hazelcast instance initialization", e); | ||
System.exit(1); | ||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Rethrowing the exception after calling System.exit(1) is redundant. Consider removing the rethrow to avoid unreachable code or adding a clarifying comment if needed for testing.
throw e; | |
// Note: The following line is unreachable due to System.exit(1). | |
// Uncomment for testing purposes if System.exit is mocked. | |
// throw e; |
Copilot uses AI. Check for mistakes.
return HazelcastInstanceFactory.newHazelcastInstance( | ||
seaTunnelConfig.getHazelcastConfig(), | ||
Thread.currentThread().getName(), | ||
new SeaTunnelNodeContext(seaTunnelConfig)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create hazelcast instance is one of potential crisis. So we should handle it in
Line 40 in 0b1122c
command.execute(); |
wating test case passes. |
Hi @CosmosNi , please merge from dev to disable dead link check. |
SeaTunnelClient can not exit with error
close #9257
Purpose of this pull request
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.