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

[Bug] [zeta] Fix null pointer exception when submitting jobs #6492

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ public void handle(HttpPostCommand httpPostCommand) {
private SeaTunnelServer getSeaTunnelServer() {
Map<String, Object> extensionServices =
this.textCommandService.getNode().getNodeExtension().createExtensionServices();
SeaTunnelServer seaTunnelServer =
(SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME);
if (!seaTunnelServer.isMasterNode()) {
return null;
}
return seaTunnelServer;
return (SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME);
}

private void handleSubmitJob(HttpPostCommand httpPostCommand, String uri)
Expand Down Expand Up @@ -137,7 +132,7 @@ private void handleSubmitJob(HttpPostCommand httpPostCommand, String uri)
: null);
JobImmutableInformation jobImmutableInformation = restJobExecutionEnvironment.build();
Long jobId = jobImmutableInformation.getJobId();
if (seaTunnelServer == null) {
if (!seaTunnelServer.isMasterNode()) {

NodeEngineUtil.sendOperationToMasterNode(
getNode().nodeEngine,
Expand Down Expand Up @@ -171,7 +166,7 @@ private void handleStopJob(HttpPostCommand httpPostCommand, String uri) {
}

SeaTunnelServer seaTunnelServer = getSeaTunnelServer();
if (seaTunnelServer == null) {
if (!seaTunnelServer.isMasterNode()) {
if (isStopWithSavePoint) {
NodeEngineUtil.sendOperationToMasterNode(
getNode().nodeEngine, new SavePointJobOperation(jobId))
Expand All @@ -183,7 +178,7 @@ private void handleStopJob(HttpPostCommand httpPostCommand, String uri) {
}

} else {
CoordinatorService coordinatorService = getSeaTunnelServer().getCoordinatorService();
CoordinatorService coordinatorService = seaTunnelServer.getCoordinatorService();

if (isStopWithSavePoint) {
coordinatorService.savePoint(jobId);
Expand Down
Loading