status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common.utils; import org.apache.dolphinscheduler.common.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HeartBeat { private static final Logger logger = LoggerFactory.getLogger(HeartBeat.class); public static final String COMMA = ","; private long startupTime; private long reportTime; private double cpuUsage; private double memoryUsage;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
private double loadAverage; private double availablePhysicalMemorySize; private double maxCpuloadAvg; private double reservedMemory; private int serverStatus; private int processId; private int workerHostWeight; private int workerWaitingTaskCount; private int workerExecThreadCount; public long getStartupTime() { return startupTime; } public void setStartupTime(long startupTime) { this.startupTime = startupTime; } public long getReportTime() { return reportTime; } public void setReportTime(long reportTime) { this.reportTime = reportTime; } public double getCpuUsage() { return cpuUsage; } public void setCpuUsage(double cpuUsage) { this.cpuUsage = cpuUsage; } public double getMemoryUsage() { return memoryUsage; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
public void setMemoryUsage(double memoryUsage) { this.memoryUsage = memoryUsage; } public double getLoadAverage() { return loadAverage; } public void setLoadAverage(double loadAverage) { this.loadAverage = loadAverage; } public double getAvailablePhysicalMemorySize() { return availablePhysicalMemorySize; } public void setAvailablePhysicalMemorySize(double availablePhysicalMemorySize) { this.availablePhysicalMemorySize = availablePhysicalMemorySize; } public double getMaxCpuloadAvg() { return maxCpuloadAvg; } public void setMaxCpuloadAvg(double maxCpuloadAvg) { this.maxCpuloadAvg = maxCpuloadAvg; } public double getReservedMemory() { return reservedMemory; } public void setReservedMemory(double reservedMemory) { this.reservedMemory = reservedMemory; } public int getServerStatus() { return serverStatus; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
public void setServerStatus(int serverStatus) { this.serverStatus = serverStatus; } public int getProcessId() { return processId; } public void setProcessId(int processId) { this.processId = processId; } public int getWorkerHostWeight() { return workerHostWeight; } public void setWorkerHostWeight(int workerHostWeight) { this.workerHostWeight = workerHostWeight; } public int getWorkerWaitingTaskCount() { return workerWaitingTaskCount; } public void setWorkerWaitingTaskCount(int workerWaitingTaskCount) { this.workerWaitingTaskCount = workerWaitingTaskCount; } public int getWorkerExecThreadCount() { return workerExecThreadCount; } public void setWorkerExecThreadCount(int workerExecThreadCount) { this.workerExecThreadCount = workerExecThreadCount; } public HeartBeat() { this.reportTime = System.currentTimeMillis(); this.serverStatus = Constants.NORMAL_NODE_STATUS;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
} public HeartBeat(long startupTime, double maxCpuloadAvg, double reservedMemory) { this.reportTime = System.currentTimeMillis(); this.serverStatus = Constants.NORMAL_NODE_STATUS; this.startupTime = startupTime; this.maxCpuloadAvg = maxCpuloadAvg; this.reservedMemory = reservedMemory; } public HeartBeat(long startupTime, double maxCpuloadAvg, double reservedMemory, int hostWeight, int workerExecThreadCount) { this.reportTime = System.currentTimeMillis(); this.serverStatus = Constants.NORMAL_NODE_STATUS; this.startupTime = startupTime; this.maxCpuloadAvg = maxCpuloadAvg; this.reservedMemory = reservedMemory; this.workerHostWeight = hostWeight; this.workerExecThreadCount = workerExecThreadCount; } /** * fill system info */ private void fillSystemInfo() { this.cpuUsage = OSUtils.cpuUsage(); this.loadAverage = OSUtils.loadAverage(); this.availablePhysicalMemorySize = OSUtils.availablePhysicalMemorySize(); this.memoryUsage = OSUtils.memoryUsage(); this.processId = OSUtils.getProcessID(); } /** * update server state */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
public void updateServerState() { if (loadAverage > maxCpuloadAvg || availablePhysicalMemorySize < reservedMemory) { logger.warn("current cpu load average {} is too high or available memory {}G is too low, under max.cpuload.avg={} and reserved.memory={}G", loadAverage, availablePhysicalMemorySize, maxCpuloadAvg, reservedMemory); this.serverStatus = Constants.ABNORMAL_NODE_STATUS; } else if (workerWaitingTaskCount > workerExecThreadCount) { logger.warn("current waiting task count {} is large than worker thread count {}, worker is busy", workerWaitingTaskCount, workerExecThreadCount); this.serverStatus = Constants.BUSY_NODE_STATUE; } else { this.serverStatus = Constants.NORMAL_NODE_STATUS; } } /** * encode heartbeat */ public String encodeHeartBeat() { this.fillSystemInfo(); this.updateServerState(); StringBuilder builder = new StringBuilder(100); builder.append(cpuUsage).append(COMMA); builder.append(memoryUsage).append(COMMA); builder.append(loadAverage).append(COMMA); builder.append(availablePhysicalMemorySize).append(Constants.COMMA); builder.append(maxCpuloadAvg).append(Constants.COMMA); builder.append(reservedMemory).append(Constants.COMMA); builder.append(startupTime).append(Constants.COMMA); builder.append(reportTime).append(Constants.COMMA); builder.append(serverStatus).append(COMMA); builder.append(processId).append(COMMA); builder.append(workerHostWeight).append(COMMA);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HeartBeat.java
builder.append(workerExecThreadCount).append(COMMA); builder.append(workerWaitingTaskCount); return builder.toString(); } /** * decode heartbeat */ public static HeartBeat decodeHeartBeat(String heartBeatInfo) { String[] parts = heartBeatInfo.split(Constants.COMMA); if (parts.length != Constants.HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH) { return null; } HeartBeat heartBeat = new HeartBeat(); heartBeat.cpuUsage = Double.parseDouble(parts[0]); heartBeat.memoryUsage = Double.parseDouble(parts[1]); heartBeat.loadAverage = Double.parseDouble(parts[2]); heartBeat.availablePhysicalMemorySize = Double.parseDouble(parts[3]); heartBeat.maxCpuloadAvg = Double.parseDouble(parts[4]); heartBeat.reservedMemory = Double.parseDouble(parts[5]); heartBeat.startupTime = Long.parseLong(parts[6]); heartBeat.reportTime = Long.parseLong(parts[7]); heartBeat.serverStatus = Integer.parseInt(parts[8]); heartBeat.processId = Integer.parseInt(parts[9]); heartBeat.workerHostWeight = Integer.parseInt(parts[10]); heartBeat.workerExecThreadCount = Integer.parseInt(parts[11]); heartBeat.workerWaitingTaskCount = Integer.parseInt(parts[12]); return heartBeat; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.registry.zookeeper; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.BASE_SLEEP_TIME; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.BLOCK_UNTIL_CONNECTED_WAIT_MS; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.CONNECTION_TIMEOUT_MS; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.DIGEST; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.MAX_RETRIES; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.NAME_SPACE; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.SERVERS; import static org.apache.dolphinscheduler.plugin.registry.zookeeper.ZookeeperConfiguration.SESSION_TIMEOUT_MS;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
import static java.util.concurrent.TimeUnit.MILLISECONDS; import org.apache.dolphinscheduler.spi.register.DataChangeEvent; import org.apache.dolphinscheduler.spi.register.ListenerManager; import org.apache.dolphinscheduler.spi.register.Registry; import org.apache.dolphinscheduler.spi.register.RegistryConnectListener; import org.apache.dolphinscheduler.spi.register.RegistryException; import org.apache.dolphinscheduler.spi.register.SubscribeListener; import org.apache.curator.RetryPolicy; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.api.ACLProvider; import org.apache.curator.framework.api.transaction.TransactionOp; import org.apache.curator.framework.recipes.cache.TreeCache; import org.apache.curator.framework.recipes.cache.TreeCacheEvent; import org.apache.curator.framework.recipes.cache.TreeCacheListener; import org.apache.curator.framework.recipes.locks.InterProcessMutex; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.utils.CloseableUtils; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.data.ACL; import java.nio.charset.StandardCharsets; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import com.google.common.base.Strings; public class ZookeeperRegistry implements Registry { private CuratorFramework client;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
/** * treeCache map * k-subscribe key * v-listener */ private Map<String, TreeCache> treeCacheMap = new HashMap<>(); /** * Distributed lock map */ private ThreadLocal<Map<String, InterProcessMutex>> threadLocalLockMap = new ThreadLocal<>(); /** * build retry policy */ private static RetryPolicy buildRetryPolicy(Map<String, String> registerData) { int baseSleepTimeMs = BASE_SLEEP_TIME.getParameterValue(registerData.get(BASE_SLEEP_TIME.getName())); int maxRetries = MAX_RETRIES.getParameterValue(registerData.get(MAX_RETRIES.getName())); int maxSleepMs = baseSleepTimeMs * maxRetries; return new ExponentialBackoffRetry(baseSleepTimeMs, maxRetries, maxSleepMs); } /** * build digest */ private static void buildDigest(CuratorFrameworkFactory.Builder builder, String digest) { builder.authorization(DIGEST.getName(), digest.getBytes(StandardCharsets.UTF_8)) .aclProvider(new ACLProvider() { @Override public List<ACL> getDefaultAcl() { return ZooDefs.Ids.CREATOR_ALL_ACL; } @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
public List<ACL> getAclForPath(final String path) { return ZooDefs.Ids.CREATOR_ALL_ACL; } }); } @Override public void init(Map<String, String> registerData) { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder() .connectString(SERVERS.getParameterValue(registerData.get(SERVERS.getName()))) .retryPolicy(buildRetryPolicy(registerData)) .namespace(NAME_SPACE.getParameterValue(registerData.get(NAME_SPACE.getName()))) .sessionTimeoutMs(SESSION_TIMEOUT_MS.getParameterValue(registerData.get(SESSION_TIMEOUT_MS.getName()))) .connectionTimeoutMs(CONNECTION_TIMEOUT_MS.getParameterValue(registerData.get(CONNECTION_TIMEOUT_MS.getName()))); String digest = DIGEST.getParameterValue(registerData.get(DIGEST.getName())); if (!Strings.isNullOrEmpty(digest)) { buildDigest(builder, digest); } client = builder.build(); client.start(); try { if (!client.blockUntilConnected(BLOCK_UNTIL_CONNECTED_WAIT_MS.getParameterValue(registerData.get(BLOCK_UNTIL_CONNECTED_WAIT_MS.getName())), MILLISECONDS)) { client.close(); throw new RegistryException("zookeeper connect timeout"); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RegistryException("zookeeper connect error", e); } } @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
public void addConnectionStateListener(RegistryConnectListener registryConnectListener) { client.getConnectionStateListenable().addListener(new ZookeeperConnectionStateListener(registryConnectListener)); } @Override public boolean subscribe(String path, SubscribeListener subscribeListener) { if (null != treeCacheMap.get(path)) { return false; } TreeCache treeCache = new TreeCache(client, path); TreeCacheListener treeCacheListener = (client, event) -> { TreeCacheEvent.Type type = event.getType(); DataChangeEvent eventType = null; String dataPath = null; switch (type) { case NODE_ADDED: dataPath = event.getData().getPath(); eventType = DataChangeEvent.ADD; break; case NODE_UPDATED: eventType = DataChangeEvent.UPDATE; dataPath = event.getData().getPath(); break; case NODE_REMOVED: eventType = DataChangeEvent.REMOVE; dataPath = event.getData().getPath(); break; default: } if (null != eventType && null != dataPath) { ListenerManager.dataChange(path, dataPath, eventType);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
} }; treeCache.getListenable().addListener(treeCacheListener); treeCacheMap.put(path, treeCache); try { treeCache.start(); } catch (Exception e) { throw new RegistryException("start zookeeper tree cache error", e); } ListenerManager.addListener(path, subscribeListener); return true; } @Override public void unsubscribe(String path) { TreeCache treeCache = treeCacheMap.get(path); treeCache.close(); ListenerManager.removeListener(path); } @Override public String get(String key) { try { return new String(client.getData().forPath(key), StandardCharsets.UTF_8); } catch (Exception e) { throw new RegistryException("zookeeper get data error", e); } } @Override public void remove(String key) { delete(key); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
@Override public boolean isExisted(String key) { try { return null != client.checkExists().forPath(key); } catch (Exception e) { throw new RegistryException("zookeeper check key is existed error", e); } } @Override public void persist(String key, String value) { try { if (isExisted(key)) { update(key, value); return; } client.create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT).forPath(key, value.getBytes(StandardCharsets.UTF_8)); } catch (Exception e) { throw new RegistryException("zookeeper persist error", e); } } @Override public void persistEphemeral(String key, String value) { try { if (isExisted(key)) { update(key, value); return; } client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(key, value.getBytes(StandardCharsets.UTF_8)); } catch (Exception e) { throw new RegistryException("zookeeper persist ephemeral error", e);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
} } @Override public void update(String key, String value) { try { if (!isExisted(key)) { return; } TransactionOp transactionOp = client.transactionOp(); client.transaction().forOperations(transactionOp.check().forPath(key), transactionOp.setData().forPath(key, value.getBytes(StandardCharsets.UTF_8))); } catch (Exception e) { throw new RegistryException("zookeeper update error", e); } } @Override public List<String> getChildren(String key) { try { List<String> result = client.getChildren().forPath(key); result.sort(Comparator.reverseOrder()); return result; } catch (Exception e) { throw new RegistryException("zookeeper get children error", e); } } @Override public boolean delete(String nodePath) { try { client.delete() .deletingChildrenIfNeeded() .forPath(nodePath);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
} catch (KeeperException.NoNodeException ignore) { } catch (Exception e) { throw new RegistryException("zookeeper delete key error", e); } return true; } @Override public boolean acquireLock(String key) { InterProcessMutex interProcessMutex = new InterProcessMutex(client, key); try { interProcessMutex.acquire(); if (null == threadLocalLockMap.get()) { threadLocalLockMap.set(new HashMap<>(3)); } threadLocalLockMap.get().put(key, interProcessMutex); return true; } catch (Exception e) { try { interProcessMutex.release(); throw new RegistryException("zookeeper get lock error", e); } catch (Exception exception) { throw new RegistryException("zookeeper release lock error", e); } } } @Override public boolean releaseLock(String key) { if (null == threadLocalLockMap.get().get(key)) { return false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/main/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistry.java
} try { threadLocalLockMap.get().get(key).release(); threadLocalLockMap.get().remove(key); if (threadLocalLockMap.get().isEmpty()) { threadLocalLockMap.remove(); } } catch (Exception e) { throw new RegistryException("zookeeper release lock error", e); } return true; } public CuratorFramework getClient() { return client; } @Override public void close() { treeCacheMap.forEach((key, value) -> value.close()); waitForCacheClose(500); CloseableUtils.closeQuietly(client); } private void waitForCacheClose(long millis) { try { Thread.sleep(millis); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/test/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.registry.zookeeper; import org.apache.dolphinscheduler.spi.register.DataChangeEvent;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/test/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryTest.java
import org.apache.dolphinscheduler.spi.register.SubscribeListener; import org.apache.curator.test.TestingServer; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ZookeeperRegistryTest { private static final Logger logger = LoggerFactory.getLogger(ZookeeperRegistryTest.class); TestingServer server; ZookeeperRegistry registry = new ZookeeperRegistry(); @Before public void before() throws Exception { server = new TestingServer(true); Map<String, String> registryConfig = new HashMap<>(); registryConfig.put(ZookeeperConfiguration.SERVERS.getName(), server.getConnectString()); registry.init(registryConfig); registry.persist("/sub", ""); } @Test public void persistTest() { registry.persist("/nodes/m1", "");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/test/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryTest.java
registry.persist("/nodes/m2", ""); Assert.assertEquals(Arrays.asList("m2", "m1"), registry.getChildren("/nodes")); Assert.assertTrue(registry.isExisted("/nodes/m1")); registry.delete("/nodes/m2"); Assert.assertFalse(registry.isExisted("/nodes/m2")); } @Test public void lockTest() throws InterruptedException { CountDownLatch preCountDownLatch = new CountDownLatch(1); CountDownLatch allCountDownLatch = new CountDownLatch(2); List<String> testData = new ArrayList<>(); new Thread(() -> { registry.acquireLock("/lock"); preCountDownLatch.countDown(); logger.info(Thread.currentThread().getName() + " :I got the lock, but I don't want to work. I want to rest for a while"); try { Thread.sleep(1000); logger.info(Thread.currentThread().getName() + " :I'm going to start working"); testData.add("thread1"); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { logger.info(Thread.currentThread().getName() + " :I have finished my work, now I release the lock"); registry.releaseLock("/lock"); allCountDownLatch.countDown(); } }).start(); preCountDownLatch.await(); new Thread(() -> { try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-registry-plugin/dolphinscheduler-registry-zookeeper/src/test/java/org/apache/dolphinscheduler/plugin/registry/zookeeper/ZookeeperRegistryTest.java
logger.info(Thread.currentThread().getName() + " :I am trying to acquire the lock"); registry.acquireLock("/lock"); logger.info(Thread.currentThread().getName() + " :I got the lock and I started working"); testData.add("thread2"); } finally { registry.releaseLock("/lock"); allCountDownLatch.countDown(); } }).start(); allCountDownLatch.await(); Assert.assertEquals(testData, Arrays.asList("thread1", "thread2")); } @Test public void subscribeTest() { boolean status = registry.subscribe("/sub", new TestListener()); Assert.assertTrue(status); } class TestListener implements SubscribeListener { @Override public void notify(String path, DataChangeEvent dataChangeEvent) { logger.info("I'm test listener"); } } @After public void after() throws IOException { registry.close(); server.close(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
*/ package org.apache.dolphinscheduler.server.master.dispatch.host; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.HeartBeat; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory; import org.apache.dolphinscheduler.server.master.dispatch.context.ExecutionContext; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.HostWeight; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.HostWorker; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.LowerWeightRoundRobin; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * lower weight host manager */ public class LowerWeightHostManager extends CommonHostManager {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
private final Logger logger = LoggerFactory.getLogger(LowerWeightHostManager.class); /** * selector */ private LowerWeightRoundRobin selector; /** * worker host weights */ private ConcurrentHashMap<String, Set<HostWeight>> workerHostWeightsMap; /** * worker group host lock */ private Lock lock; /** * executor service */ private ScheduledExecutorService executorService; @PostConstruct public void init() { this.selector = new LowerWeightRoundRobin(); this.workerHostWeightsMap = new ConcurrentHashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
this.lock = new ReentrantLock(); this.executorService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LowerWeightHostManagerExecutor")); this.executorService.scheduleWithFixedDelay(new RefreshResourceTask(), 0, 5, TimeUnit.SECONDS); } @PreDestroy public void close() { this.executorService.shutdownNow(); } /** * select host * * @param context context * @return host */ @Override public Host select(ExecutionContext context) { Set<HostWeight> workerHostWeights = getWorkerHostWeights(context.getWorkerGroup()); if (CollectionUtils.isNotEmpty(workerHostWeights)) { return selector.select(workerHostWeights).getHost(); } return new Host(); } @Override public HostWorker select(Collection<HostWorker> nodes) { throw new UnsupportedOperationException("not support"); } private void syncWorkerHostWeight(Map<String, Set<HostWeight>> workerHostWeights) { lock.lock(); try { workerHostWeightsMap.clear();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
workerHostWeightsMap.putAll(workerHostWeights); } finally { lock.unlock(); } } private Set<HostWeight> getWorkerHostWeights(String workerGroup) { lock.lock(); try { return workerHostWeightsMap.get(workerGroup); } finally { lock.unlock(); } } class RefreshResourceTask implements Runnable { @Override public void run() { try { Map<String, Set<HostWeight>> workerHostWeights = new HashMap<>(); Map<String, Set<String>> workerGroupNodes = serverNodeManager.getWorkerGroupNodes(); for (Map.Entry<String, Set<String>> entry : workerGroupNodes.entrySet()) { String workerGroup = entry.getKey(); Set<String> nodes = entry.getValue(); Set<HostWeight> hostWeights = new HashSet<>(nodes.size()); for (String node : nodes) { String heartbeat = serverNodeManager.getWorkerNodeInfo(node); HostWeight hostWeight = getHostWeight(node, workerGroup, heartbeat); if (hostWeight != null) { hostWeights.add(hostWeight); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
if (!hostWeights.isEmpty()) { workerHostWeights.put(workerGroup, hostWeights); } } syncWorkerHostWeight(workerHostWeights); } catch (Throwable ex) { logger.error("RefreshResourceTask error", ex); } } public HostWeight getHostWeight(String addr, String workerGroup, String heartBeatInfo) { HeartBeat heartBeat = HeartBeat.decodeHeartBeat(heartBeatInfo); if (heartBeat == null) { return null; } if (Constants.ABNORMAL_NODE_STATUS == heartBeat.getServerStatus()) { logger.warn("worker {} current cpu load average {} is too high or available memory {}G is too low", addr, heartBeat.getLoadAverage(), heartBeat.getAvailablePhysicalMemorySize()); return null; } if (Constants.BUSY_NODE_STATUE == heartBeat.getServerStatus()) { logger.warn("worker {} is busy, current waiting task count {} is large than worker thread count {}", addr, heartBeat.getWorkerWaitingTaskCount(), heartBeat.getWorkerExecThreadCount()); return null; } return new HostWeight(HostWorker.of(addr, heartBeat.getWorkerHostWeight(), workerGroup), heartBeat.getCpuUsage(), heartBeat.getMemoryUsage(), heartBeat.getLoadAverage(), heartBeat.getStartupTime()); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryDataListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.registry; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.spi.register.DataChangeEvent; import org.apache.dolphinscheduler.spi.register.SubscribeListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class MasterRegistryDataListener implements SubscribeListener {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryDataListener.java
private static final Logger logger = LoggerFactory.getLogger(MasterRegistryDataListener.class); private MasterRegistryClient masterRegistryClient; public MasterRegistryDataListener() { masterRegistryClient = SpringApplicationContext.getBean(MasterRegistryClient.class); } @Override public void notify(String path, DataChangeEvent event) { if (path.startsWith(REGISTRY_DOLPHINSCHEDULER_MASTERS + Constants.SINGLE_SLASH)) { handleMasterEvent(event, path); } else if (path.startsWith(REGISTRY_DOLPHINSCHEDULER_WORKERS + Constants.SINGLE_SLASH)) { handleWorkerEvent(event, path); } } /** * monitor master * * @param event event * @param path path */ public void handleMasterEvent(DataChangeEvent event, String path) { switch (event) { case ADD:
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryDataListener.java
logger.info("master node added : {}", path); break; case REMOVE: masterRegistryClient.removeNodePath(path, NodeType.MASTER, true); break; default: break; } } /** * monitor worker * * @param event event * @param path path */ public void handleWorkerEvent(DataChangeEvent event, String path) { switch (event) { case ADD: logger.info("worker node added : {}", path); break; case REMOVE: logger.info("worker node deleted : {}", path); masterRegistryClient.removeNodePath(path, NodeType.WORKER, true); break; default: break; } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master.registry; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_MASTERS; import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.model.Server; import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.dao.entity.WorkerGroup; import org.apache.dolphinscheduler.dao.mapper.WorkerGroupMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory; import org.apache.dolphinscheduler.service.queue.MasterPriorityQueue; import org.apache.dolphinscheduler.service.registry.RegistryClient; import org.apache.dolphinscheduler.spi.register.DataChangeEvent; import org.apache.dolphinscheduler.spi.register.SubscribeListener; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * server node manager */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
public class ServerNodeManager implements InitializingBean { private final Logger logger = LoggerFactory.getLogger(ServerNodeManager.class); /** * master lock */ private final Lock masterLock = new ReentrantLock(); /** * worker group lock */ private final Lock workerGroupLock = new ReentrantLock(); /** * worker node info lock
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
*/ private final Lock workerNodeInfoLock = new ReentrantLock(); /** * worker group nodes */ private final ConcurrentHashMap<String, Set<String>> workerGroupNodes = new ConcurrentHashMap<>(); /** * master nodes */ private final Set<String> masterNodes = new HashSet<>(); /** * worker node info */ private final Map<String, String> workerNodeInfo = new HashMap<>(); /** * executor service */ private ScheduledExecutorService executorService; /** * zk client */ private RegistryClient registryClient = RegistryClient.getInstance(); /** * eg : /node/worker/group/127.0.0.1:xxx */ private static final int WORKER_LISTENER_CHECK_LENGTH = 5; /** * worker group mapper */ @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
private WorkerGroupMapper workerGroupMapper; private MasterPriorityQueue masterPriorityQueue = new MasterPriorityQueue(); /** * alert dao */ @Autowired private AlertDao alertDao; public static volatile List<Integer> SLOT_LIST = new ArrayList<>(); public static volatile Integer MASTER_SIZE = 0; public static Integer getSlot() { if (SLOT_LIST.size() > 0) { return SLOT_LIST.get(0); } return 0; } /** * init listener * * @throws Exception if error throws Exception */ @Override public void afterPropertiesSet() throws Exception { /** * load nodes from zookeeper */ load(); /** * init executor service */ executorService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("ServerNodeManagerExecutor"));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
executorService.scheduleWithFixedDelay(new WorkerNodeInfoAndGroupDbSyncTask(), 0, 10, TimeUnit.SECONDS); /** * init MasterNodeListener listener */ registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_MASTERS, new MasterDataListener()); /** * init WorkerNodeListener listener */ registryClient.subscribe(REGISTRY_DOLPHINSCHEDULER_WORKERS, new WorkerDataListener()); } /** * load nodes from zookeeper */ public void load() { /** * master nodes from zookeeper */ updateMasterNodes(); /** * worker group nodes from zookeeper */ Set<String> workerGroups = registryClient.getWorkerGroupDirectly(); for (String workerGroup : workerGroups) { syncWorkerGroupNodes(workerGroup, registryClient.getWorkerGroupNodesDirectly(workerGroup)); } } /** * worker node info and worker group db sync task */ class WorkerNodeInfoAndGroupDbSyncTask implements Runnable {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
@Override public void run() { Map<String, String> newWorkerNodeInfo = registryClient.getServerMaps(NodeType.WORKER, true); syncWorkerNodeInfo(newWorkerNodeInfo); List<WorkerGroup> workerGroupList = workerGroupMapper.queryAllWorkerGroup(); if (CollectionUtils.isNotEmpty(workerGroupList)) { for (WorkerGroup wg : workerGroupList) { String workerGroup = wg.getName(); Set<String> nodes = new HashSet<>(); String[] addrs = wg.getAddrList().split(Constants.COMMA); for (String addr : addrs) { if (newWorkerNodeInfo.containsKey(addr)) { nodes.add(addr); } } if (!nodes.isEmpty()) { syncWorkerGroupNodes(workerGroup, nodes); } } } } } /** * worker group node listener */ class WorkerDataListener implements SubscribeListener {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
@Override public void notify(String path, DataChangeEvent dataChangeEvent) { if (registryClient.isWorkerPath(path)) { try { if (dataChangeEvent == DataChangeEvent.ADD) { logger.info("worker group node : {} added.", path); String group = parseGroup(path); Set<String> currentNodes = registryClient.getWorkerGroupNodesDirectly(group); logger.info("currentNodes : {}", currentNodes); syncWorkerGroupNodes(group, currentNodes); } else if (dataChangeEvent == DataChangeEvent.REMOVE) { logger.info("worker group node : {} down.", path); String group = parseGroup(path); Set<String> currentNodes = registryClient.getWorkerGroupNodesDirectly(group);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
syncWorkerGroupNodes(group, currentNodes); alertDao.sendServerStopedAlert(1, path, "WORKER"); } } catch (IllegalArgumentException ex) { logger.warn(ex.getMessage()); } catch (Exception ex) { logger.error("WorkerGroupListener capture data change and get data failed", ex); } } } private String parseGroup(String path) { String[] parts = path.split("/"); if (parts.length < WORKER_LISTENER_CHECK_LENGTH) { throw new IllegalArgumentException(String.format("worker group path : %s is not valid, ignore", path)); } return parts[parts.length - 2]; } } /** * master node listener */ class MasterDataListener implements SubscribeListener { @Override public void notify(String path, DataChangeEvent dataChangeEvent) { if (registryClient.isMasterPath(path)) { try { if (dataChangeEvent.equals(DataChangeEvent.ADD)) { logger.info("master node : {} added.", path); updateMasterNodes(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
if (dataChangeEvent.equals(DataChangeEvent.REMOVE)) { logger.info("master node : {} down.", path); updateMasterNodes(); alertDao.sendServerStopedAlert(1, path, "MASTER"); } } catch (Exception ex) { logger.error("MasterNodeListener capture data change and get data failed.", ex); } } } } private void updateMasterNodes() { SLOT_LIST.clear(); this.masterNodes.clear(); String nodeLock = registryClient.getMasterLockPath(); try { registryClient.getLock(nodeLock); Set<String> currentNodes = registryClient.getMasterNodesDirectly(); List<Server> masterNodes = registryClient.getServerList(NodeType.MASTER); syncMasterNodes(currentNodes, masterNodes); } catch (Exception e) { logger.error("update master nodes error", e); } finally { registryClient.releaseLock(nodeLock); } } /** * get master nodes * * @return master nodes
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
*/ public Set<String> getMasterNodes() { masterLock.lock(); try { return Collections.unmodifiableSet(masterNodes); } finally { masterLock.unlock(); } } /** * sync master nodes * * @param nodes master nodes */ private void syncMasterNodes(Set<String> nodes, List<Server> masterNodes) { masterLock.lock(); try { this.masterNodes.addAll(nodes); this.masterPriorityQueue.clear(); this.masterPriorityQueue.putList(masterNodes); int index = masterPriorityQueue.getIndex(NetUtils.getHost()); if (index >= 0) { MASTER_SIZE = nodes.size(); SLOT_LIST.add(masterPriorityQueue.getIndex(NetUtils.getHost())); } logger.info("update master nodes, master size: {}, slot: {}", MASTER_SIZE, SLOT_LIST.toString() ); } finally { masterLock.unlock();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
} } /** * sync worker group nodes * * @param workerGroup worker group * @param nodes worker nodes */ private void syncWorkerGroupNodes(String workerGroup, Set<String> nodes) { workerGroupLock.lock(); try { workerGroup = workerGroup.toLowerCase(); Set<String> workerNodes = workerGroupNodes.getOrDefault(workerGroup, new HashSet<>()); workerNodes.clear(); workerNodes.addAll(nodes); workerGroupNodes.put(workerGroup, workerNodes); } finally { workerGroupLock.unlock(); } } public Map<String, Set<String>> getWorkerGroupNodes() { return Collections.unmodifiableMap(workerGroupNodes); } /** * get worker group nodes * * @param workerGroup workerGroup * @return worker nodes */ public Set<String> getWorkerGroupNodes(String workerGroup) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
workerGroupLock.lock(); try { if (StringUtils.isEmpty(workerGroup)) { workerGroup = Constants.DEFAULT_WORKER_GROUP; } workerGroup = workerGroup.toLowerCase(); Set<String> nodes = workerGroupNodes.get(workerGroup); if (CollectionUtils.isNotEmpty(nodes)) { return Collections.unmodifiableSet(nodes); } return nodes; } finally { workerGroupLock.unlock(); } } /** * get worker node info * * @return worker node info */ public Map<String, String> getWorkerNodeInfo() { return Collections.unmodifiableMap(workerNodeInfo); } /** * get worker node info * * @param workerNode worker node * @return worker node info */ public String getWorkerNodeInfo(String workerNode) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/ServerNodeManager.java
workerNodeInfoLock.lock(); try { return workerNodeInfo.getOrDefault(workerNode, null); } finally { workerNodeInfoLock.unlock(); } } /** * sync worker node info * * @param newWorkerNodeInfo new worker node info */ private void syncWorkerNodeInfo(Map<String, String> newWorkerNodeInfo) { workerNodeInfoLock.lock(); try { workerNodeInfo.clear(); workerNodeInfo.putAll(newWorkerNodeInfo); } finally { workerNodeInfoLock.unlock(); } } /** * destroy */ @PreDestroy public void destroy() { executorService.shutdownNow(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/register/ListenerManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.spi.register; import java.util.HashMap; /** * The registry node monitors subscriptions */ public class ListenerManager { /** * All message subscriptions must be subscribed uniformly at startup. * A node path only supports one listener */ private static HashMap<String, SubscribeListener> listeners = new HashMap<>(); /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/register/ListenerManager.java
* Check whether the key has been monitored */ public static boolean checkHasListeners(String path) { return null != listeners.get(path); } /** * add listener(A node can only be monitored by one listener) */ public static void addListener(String path, SubscribeListener listener) { listeners.put(path, listener); } /** * remove listener */ public static void removeListener(String path) { listeners.remove(path); } /** * *After the data changes, it is distributed to the corresponding listener for processing */ public static void dataChange(String key,String path, DataChangeEvent dataChangeEvent) { SubscribeListener notifyListener = listeners.get(key); if (null == notifyListener) { return; } notifyListener.notify(path,dataChangeEvent); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,694
[Feature][Master] Reduce the refresh resource interval of LowerWeight
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Now the refresh resource interval of LowerWeight is 5s, it means that Master sync worker weight every 5s. When Worker send heartbeat every second, I want that Master can get it more timely, which can make smoother task running. ### Use case Reduce the refresh resource interval of LowerWeight ### Related issues _No response_ ### Are you willing to submit a PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6694
https://github.com/apache/dolphinscheduler/pull/6695
5855c936a4a3daafcc12b408a46b8e8470ec34c4
72daba58cd378a347e9657b994bb631c0704fc2a
"2021-11-04T10:36:25Z"
java
"2021-11-05T11:10:36Z"
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/register/SubscribeListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.spi.register; /** * Registration center subscription. All listeners must implement this interface */ public interface SubscribeListener { /** * Processing logic when the subscription node changes */ void notify(String path, DataChangeEvent dataChangeEvent); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.api.service.impl; import org.apache.dolphinscheduler.api.enums.Status;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
import org.apache.dolphinscheduler.api.service.WorkerGroupService; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.RegistryCenterUtils; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.NodeType; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.entity.WorkerGroup; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.WorkerGroupMapper; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.facebook.presto.jdbc.internal.guava.base.Strings; /** * worker group service impl */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGroupService { private static final Logger logger = LoggerFactory.getLogger(WorkerGroupServiceImpl.class); @Autowired WorkerGroupMapper workerGroupMapper; @Autowired ProcessInstanceMapper processInstanceMapper; /** * create or update a worker group * * @param loginUser login user * @param id worker group id * @param name worker group name * @param addrList addr list * @return create or update result code */ @Override public Map<String, Object> saveWorkerGroup(User loginUser, int id, String name, String addrList) { Map<String, Object> result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { return result;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
} if (StringUtils.isEmpty(name)) { putMsg(result, Status.NAME_NULL); return result; } Date now = new Date(); WorkerGroup workerGroup; if (id != 0) { workerGroup = workerGroupMapper.selectById(id); if (workerGroup == null) { workerGroup = new WorkerGroup(); workerGroup.setCreateTime(now); } } else { workerGroup = new WorkerGroup(); workerGroup.setCreateTime(now); } workerGroup.setName(name); workerGroup.setAddrList(addrList); workerGroup.setUpdateTime(now); if (checkWorkerGroupNameExists(workerGroup)) { putMsg(result, Status.NAME_EXIST, workerGroup.getName()); return result; } String invalidAddr = checkWorkerGroupAddrList(workerGroup); if (invalidAddr != null) { putMsg(result, Status.WORKER_ADDRESS_INVALID, invalidAddr); return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
if (workerGroup.getId() != 0) { workerGroupMapper.updateById(workerGroup); } else { workerGroupMapper.insert(workerGroup); } putMsg(result, Status.SUCCESS); return result; } /** * check worker group name exists * * @param workerGroup worker group * @return boolean */ private boolean checkWorkerGroupNameExists(WorkerGroup workerGroup) { List<WorkerGroup> workerGroupList = workerGroupMapper.queryWorkerGroupByName(workerGroup.getName()); if (CollectionUtils.isNotEmpty(workerGroupList)) { if (workerGroup.getId() == 0) { return true; } for (WorkerGroup group : workerGroupList) { if (group.getId() != workerGroup.getId()) { return true; } } } String workerGroupPath = Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS + Constants.SINGLE_SLASH + workerGroup.getName();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
return RegistryCenterUtils.isNodeExisted(workerGroupPath); } /** * check worker group addr list * * @param workerGroup worker group * @return boolean */ private String checkWorkerGroupAddrList(WorkerGroup workerGroup) { Map<String, String> serverMaps = RegistryCenterUtils.getServerMaps(NodeType.WORKER, true); if (Strings.isNullOrEmpty(workerGroup.getAddrList())) { return null; } for (String addr : workerGroup.getAddrList().split(Constants.COMMA)) { if (!serverMaps.containsKey(addr)) { return addr; } } return null; } /** * query worker group paging * * @param loginUser login user * @param pageNo page number * @param searchVal search value * @param pageSize page size * @return worker group list page */ @Override
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
public Result queryAllGroupPaging(User loginUser, Integer pageNo, Integer pageSize, String searchVal) { int fromIndex = (pageNo - 1) * pageSize; int toIndex = (pageNo - 1) * pageSize + pageSize; Result result = new Result(); if (!isAdmin(loginUser)) { putMsg(result,Status.USER_NO_OPERATION_PERM); return result; } List<WorkerGroup> workerGroups = getWorkerGroups(true); List<WorkerGroup> resultDataList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(workerGroups)) { List<WorkerGroup> searchValDataList = new ArrayList<>(); if (!StringUtils.isEmpty(searchVal)) { for (WorkerGroup workerGroup : workerGroups) { if (workerGroup.getName().contains(searchVal)) { searchValDataList.add(workerGroup); } } } else { searchValDataList = workerGroups; } if (fromIndex < searchValDataList.size()) { if (toIndex > searchValDataList.size()) { toIndex = searchValDataList.size(); } resultDataList = searchValDataList.subList(fromIndex, toIndex); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
PageInfo<WorkerGroup> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotal(resultDataList.size()); pageInfo.setTotalList(resultDataList); result.setData(pageInfo); putMsg(result, Status.SUCCESS); return result; } /** * query all worker group * * @return all worker group list */ @Override public Map<String, Object> queryAllGroup() { Map<String, Object> result = new HashMap<>(); List<WorkerGroup> workerGroups = getWorkerGroups(false); List<String> availableWorkerGroupList = workerGroups.stream() .map(WorkerGroup::getName) .collect(Collectors.toList()); int index = availableWorkerGroupList.indexOf(Constants.DEFAULT_WORKER_GROUP); if (index > -1) { availableWorkerGroupList.remove(index); availableWorkerGroupList.add(0, Constants.DEFAULT_WORKER_GROUP); } result.put(Constants.DATA_LIST, availableWorkerGroupList); putMsg(result, Status.SUCCESS); return result; } /** * get worker groups
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
* * @param isPaging whether paging * @return WorkerGroup list */ private List<WorkerGroup> getWorkerGroups(boolean isPaging) { List<WorkerGroup> workerGroups = workerGroupMapper.queryAllWorkerGroup(); String workerPath = Constants.REGISTRY_DOLPHINSCHEDULER_WORKERS; List<String> workerGroupList = null; try { workerGroupList = RegistryCenterUtils.getChildrenNodes(workerPath); } catch (Exception e) { logger.error("getWorkerGroups exception: {}, workerPath: {}, isPaging: {}", e.getMessage(), workerPath, isPaging); } if (CollectionUtils.isEmpty(workerGroupList)) { if (CollectionUtils.isEmpty(workerGroups) && !isPaging) { WorkerGroup wg = new WorkerGroup(); wg.setName(Constants.DEFAULT_WORKER_GROUP); workerGroups.add(wg); } return workerGroups; } for (String workerGroup : workerGroupList) { String workerGroupPath = workerPath + Constants.SINGLE_SLASH + workerGroup; List<String> childrenNodes = null; try { childrenNodes = RegistryCenterUtils.getChildrenNodes(workerGroupPath); } catch (Exception e) { logger.error("getChildrenNodes exception: {}, workerGroupPath: {}", e.getMessage(), workerGroupPath);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
} if (childrenNodes == null || childrenNodes.isEmpty()) { continue; } WorkerGroup wg = new WorkerGroup(); wg.setName(workerGroup); if (isPaging) { wg.setAddrList(String.join(Constants.COMMA, childrenNodes)); String registeredValue = RegistryCenterUtils.getNodeData(workerGroupPath + Constants.SINGLE_SLASH + childrenNodes.get(0)); wg.setCreateTime(DateUtils.stringToDate(registeredValue.split(Constants.COMMA)[6])); wg.setUpdateTime(DateUtils.stringToDate(registeredValue.split(Constants.COMMA)[7])); wg.setSystemDefault(true); } workerGroups.add(wg); } return workerGroups; } /** * delete worker group by id * * @param id worker group id * @return delete result code */ @Override @Transactional(rollbackFor = Exception.class) public Map<String, Object> deleteWorkerGroupById(User loginUser, Integer id) { Map<String, Object> result = new HashMap<>(); if (isNotAdmin(loginUser, result)) { return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,701
[Bug] [API] Query worker group list ,paging error
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When worker group number has been added more than 10,page size is 10,paging is error:there is no second page. ### What you expected to happen Increase worker group number more than 10,paging is correct. ### How to reproduce Increase worker group number more than 10. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6701
https://github.com/apache/dolphinscheduler/pull/6704
5e923971bfc49f6705b25ed4bbeb214904d3291f
d4d59b0627237e73f6ca1762882938beee596e34
"2021-11-05T07:45:27Z"
java
"2021-11-05T12:23:20Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java
WorkerGroup workerGroup = workerGroupMapper.selectById(id); if (workerGroup == null) { putMsg(result, Status.DELETE_WORKER_GROUP_NOT_EXIST); return result; } List<ProcessInstance> processInstances = processInstanceMapper.queryByWorkerGroupNameAndStatus(workerGroup.getName(), Constants.NOT_TERMINATED_STATES); if (CollectionUtils.isNotEmpty(processInstances)) { putMsg(result, Status.DELETE_WORKER_GROUP_BY_ID_FAIL, processInstances.size()); return result; } workerGroupMapper.deleteById(id); processInstanceMapper.updateProcessInstanceByWorkerGroupName(workerGroup.getName(), ""); putMsg(result, Status.SUCCESS); return result; } /** * query all worker address list * * @return all worker address list */ @Override public Map<String, Object> getWorkerAddressList() { Map<String, Object> result = new HashMap<>(); List<String> serverNodeList = RegistryCenterUtils.getServerNodeList(NodeType.WORKER, true); result.put(Constants.DATA_LIST, serverNodeList); putMsg(result, Status.SUCCESS); return result; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.dao.utils; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.graph.DAG; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; import org.apache.dolphinscheduler.common.process.ProcessDag; import org.apache.dolphinscheduler.common.task.conditions.ConditionsParameters; import org.apache.dolphinscheduler.common.task.switchtask.SwitchParameters; import org.apache.dolphinscheduler.common.task.switchtask.SwitchResultVo; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * dag tools */ public class DagHelper {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
private static final Logger logger = LoggerFactory.getLogger(DagHelper.class); /** * generate flow node relation list by task node list; * Edges that are not in the task Node List will not be added to the result * * @param taskNodeList taskNodeList * @return task node relation list */ public static List<TaskNodeRelation> generateRelationListByFlowNodes(List<TaskNode> taskNodeList) { List<TaskNodeRelation> nodeRelationList = new ArrayList<>(); for (TaskNode taskNode : taskNodeList) { String preTasks = taskNode.getPreTasks(); List<String> preTaskList = JSONUtils.toList(preTasks, String.class); if (preTaskList != null) { for (String depNodeCode : preTaskList) { if (null != findNodeByCode(taskNodeList, depNodeCode)) { nodeRelationList.add(new TaskNodeRelation(depNodeCode, Long.toString(taskNode.getCode()))); } } } } return nodeRelationList; } /** * generate task nodes needed by dag * * @param taskNodeList taskNodeList
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
* @param startNodeNameList startNodeNameList * @param recoveryNodeCodeList recoveryNodeCodeList * @param taskDependType taskDependType * @return task node list */ public static List<TaskNode> generateFlowNodeListByStartNode(List<TaskNode> taskNodeList, List<String> startNodeNameList, List<String> recoveryNodeCodeList, TaskDependType taskDependType) { List<TaskNode> destFlowNodeList = new ArrayList<>(); List<String> startNodeList = startNodeNameList; if (taskDependType != TaskDependType.TASK_POST && CollectionUtils.isEmpty(startNodeList)) { logger.error("start node list is empty! cannot continue run the process "); return destFlowNodeList; } List<TaskNode> destTaskNodeList = new ArrayList<>(); List<TaskNode> tmpTaskNodeList = new ArrayList<>(); if (taskDependType == TaskDependType.TASK_POST && CollectionUtils.isNotEmpty(recoveryNodeCodeList)) { startNodeList = recoveryNodeCodeList; } if (CollectionUtils.isEmpty(startNodeList)) { tmpTaskNodeList = taskNodeList; } else { for (String startNodeCode : startNodeList) { TaskNode startNode = findNodeByCode(taskNodeList, startNodeCode); List<TaskNode> childNodeList = new ArrayList<>(); if (startNode == null) { logger.error("start node name [{}] is not in task node list [{}] ",
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
startNodeCode, taskNodeList ); continue; } else if (TaskDependType.TASK_POST == taskDependType) { List<String> visitedNodeCodeList = new ArrayList<>(); childNodeList = getFlowNodeListPost(startNode, taskNodeList, visitedNodeCodeList); } else if (TaskDependType.TASK_PRE == taskDependType) { List<String> visitedNodeCodeList = new ArrayList<>(); childNodeList = getFlowNodeListPre(startNode, recoveryNodeCodeList, taskNodeList, visitedNodeCodeList); } else { childNodeList.add(startNode); } tmpTaskNodeList.addAll(childNodeList); } } for (TaskNode taskNode : tmpTaskNodeList) { if (null == findNodeByCode(destTaskNodeList, Long.toString(taskNode.getCode()))) { destTaskNodeList.add(taskNode); } } return destTaskNodeList; } /** * find all the nodes that depended on the start node * * @param startNode startNode * @param taskNodeList taskNodeList * @return task node list */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
private static List<TaskNode> getFlowNodeListPost(TaskNode startNode, List<TaskNode> taskNodeList, List<String> visitedNodeCodeList) { List<TaskNode> resultList = new ArrayList<>(); for (TaskNode taskNode : taskNodeList) { List<String> depList = taskNode.getDepList(); if (null != depList && null != startNode && depList.contains(Long.toString(startNode.getCode())) && !visitedNodeCodeList.contains(Long.toString(taskNode.getCode()))) { resultList.addAll(getFlowNodeListPost(taskNode, taskNodeList, visitedNodeCodeList)); } } if (null != startNode) { visitedNodeCodeList.add(Long.toString(startNode.getCode())); } resultList.add(startNode); return resultList; } /** * find all nodes that start nodes depend on. * * @param startNode startNode * @param recoveryNodeCodeList recoveryNodeCodeList * @param taskNodeList taskNodeList * @return task node list */ private static List<TaskNode> getFlowNodeListPre(TaskNode startNode, List<String> recoveryNodeCodeList, List<TaskNode> taskNodeList, List<String> visitedNodeCodeList) { List<TaskNode> resultList = new ArrayList<>(); List<String> depList = new ArrayList<>(); if (null != startNode) { depList = startNode.getDepList(); resultList.add(startNode); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
if (CollectionUtils.isEmpty(depList)) { return resultList; } for (String depNodeCode : depList) { TaskNode start = findNodeByCode(taskNodeList, depNodeCode); if (recoveryNodeCodeList.contains(depNodeCode)) { resultList.add(start); } else if (!visitedNodeCodeList.contains(depNodeCode)) { resultList.addAll(getFlowNodeListPre(start, recoveryNodeCodeList, taskNodeList, visitedNodeCodeList)); } } if (null != startNode) { visitedNodeCodeList.add(Long.toString(startNode.getCode())); } return resultList; } /** * generate dag by start nodes and recovery nodes * * @param totalTaskNodeList totalTaskNodeList * @param startNodeNameList startNodeNameList * @param recoveryNodeCodeList recoveryNodeCodeList * @param depNodeType depNodeType * @return process dag * @throws Exception if error throws Exception */ public static ProcessDag generateFlowDag(List<TaskNode> totalTaskNodeList, List<String> startNodeNameList, List<String> recoveryNodeCodeList,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
TaskDependType depNodeType) throws Exception { List<TaskNode> destTaskNodeList = generateFlowNodeListByStartNode(totalTaskNodeList, startNodeNameList, recoveryNodeCodeList, depNodeType); if (destTaskNodeList.isEmpty()) { return null; } List<TaskNodeRelation> taskNodeRelations = generateRelationListByFlowNodes(destTaskNodeList); ProcessDag processDag = new ProcessDag(); processDag.setEdges(taskNodeRelations); processDag.setNodes(destTaskNodeList); return processDag; } /** * find node by node name * * @param nodeDetails nodeDetails * @param nodeName nodeName * @return task node */ public static TaskNode findNodeByName(List<TaskNode> nodeDetails, String nodeName) { for (TaskNode taskNode : nodeDetails) { if (taskNode.getName().equals(nodeName)) { return taskNode; } } return null; } /** * find node by node code * * @param nodeDetails nodeDetails
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
* @param nodeCode nodeCode * @return task node */ public static TaskNode findNodeByCode(List<TaskNode> nodeDetails, String nodeCode) { for (TaskNode taskNode : nodeDetails) { if (Long.toString(taskNode.getCode()).equals(nodeCode)) { return taskNode; } } return null; } /** * the task can be submit when all the depends nodes are forbidden or complete * * @param taskNode taskNode * @param dag dag * @param completeTaskList completeTaskList * @return can submit */ public static boolean allDependsForbiddenOrEnd(TaskNode taskNode, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskNode> skipTaskNodeList, Map<String, TaskInstance> completeTaskList) { List<String> dependList = taskNode.getDepList(); if (dependList == null) { return true; } for (String dependNodeCode : dependList) { TaskNode dependNode = dag.getNode(dependNodeCode); if (dependNode == null || completeTaskList.containsKey(dependNodeCode)
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
|| dependNode.isForbidden() || skipTaskNodeList.containsKey(dependNodeCode)) { continue; } else { return false; } } return true; } /** * parse the successor nodes of previous node. * this function parse the condition node to find the right branch. * also check all the depends nodes forbidden or complete * * @return successor nodes */ public static Set<String> parsePostNodes(String preNodeCode, Map<String, TaskNode> skipTaskNodeList, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList) { Set<String> postNodeList = new HashSet<>(); Collection<String> startVertexes = new ArrayList<>(); if (preNodeCode == null) { startVertexes = dag.getBeginNode(); } else if (dag.getNode(preNodeCode).isConditionsTask()) { List<String> conditionTaskList = parseConditionTask(preNodeCode, skipTaskNodeList, dag, completeTaskList); startVertexes.addAll(conditionTaskList); } else if (dag.getNode(preNodeCode).isSwitchTask()) { List<String> conditionTaskList = parseSwitchTask(preNodeCode, skipTaskNodeList, dag, completeTaskList); startVertexes.addAll(conditionTaskList);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
} else { startVertexes = dag.getSubsequentNodes(preNodeCode); } for (String subsequent : startVertexes) { TaskNode taskNode = dag.getNode(subsequent); if (isTaskNodeNeedSkip(taskNode, skipTaskNodeList)) { setTaskNodeSkip(subsequent, dag, completeTaskList, skipTaskNodeList); continue; } if (!DagHelper.allDependsForbiddenOrEnd(taskNode, dag, skipTaskNodeList, completeTaskList)) { continue; } if (taskNode.isForbidden() || completeTaskList.containsKey(subsequent)) { postNodeList.addAll(parsePostNodes(subsequent, skipTaskNodeList, dag, completeTaskList)); continue; } postNodeList.add(subsequent); } return postNodeList; } /** * if all of the task dependence are skipped, skip it too. */ private static boolean isTaskNodeNeedSkip(TaskNode taskNode, Map<String, TaskNode> skipTaskNodeList ) { if (CollectionUtils.isEmpty(taskNode.getDepList())) { return false; } for (String depNode : taskNode.getDepList()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
if (!skipTaskNodeList.containsKey(depNode)) { return false; } } return true; } /** * parse condition task find the branch process * set skip flag for another one. */ public static List<String> parseConditionTask(String nodeCode, Map<String, TaskNode> skipTaskNodeList, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList) { List<String> conditionTaskList = new ArrayList<>(); TaskNode taskNode = dag.getNode(nodeCode); if (!taskNode.isConditionsTask()) { return conditionTaskList; } if (!completeTaskList.containsKey(nodeCode)) { return conditionTaskList; } TaskInstance taskInstance = completeTaskList.get(nodeCode); ConditionsParameters conditionsParameters = JSONUtils.parseObject(taskNode.getConditionResult(), ConditionsParameters.class); List<String> skipNodeList = new ArrayList<>(); if (taskInstance.getState().typeIsSuccess()) { conditionTaskList = conditionsParameters.getSuccessNode(); skipNodeList = conditionsParameters.getFailedNode(); } else if (taskInstance.getState().typeIsFailure()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
conditionTaskList = conditionsParameters.getFailedNode(); skipNodeList = conditionsParameters.getSuccessNode(); } else { conditionTaskList.add(nodeCode); } for (String failedNode : skipNodeList) { setTaskNodeSkip(failedNode, dag, completeTaskList, skipTaskNodeList); } return conditionTaskList; } /** * parse condition task find the branch process * set skip flag for another one. * * @param nodeCode * @return */ public static List<String> parseSwitchTask(String nodeCode, Map<String, TaskNode> skipTaskNodeList, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList) { List<String> conditionTaskList = new ArrayList<>(); TaskNode taskNode = dag.getNode(nodeCode); if (!taskNode.isSwitchTask()) { return conditionTaskList; } if (!completeTaskList.containsKey(nodeCode)) { return conditionTaskList; } conditionTaskList = skipTaskNode4Switch(taskNode, skipTaskNodeList, completeTaskList, dag);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
return conditionTaskList; } private static List<String> skipTaskNode4Switch(TaskNode taskNode, Map<String, TaskNode> skipTaskNodeList, Map<String, TaskInstance> completeTaskList, DAG<String, TaskNode, TaskNodeRelation> dag) { SwitchParameters switchParameters = completeTaskList.get(taskNode.getName()).getSwitchDependency(); int resultConditionLocation = switchParameters.getResultConditionLocation(); List<SwitchResultVo> conditionResultVoList = switchParameters.getDependTaskList(); List<String> switchTaskList = conditionResultVoList.get(resultConditionLocation).getNextNode(); if (CollectionUtils.isEmpty(switchTaskList)) { switchTaskList = new ArrayList<>(); } conditionResultVoList.remove(resultConditionLocation); for (SwitchResultVo info : conditionResultVoList) { if (CollectionUtils.isEmpty(info.getNextNode())) { continue; } setTaskNodeSkip(info.getNextNode().get(0), dag, completeTaskList, skipTaskNodeList); } return switchTaskList; } /** * set task node and the post nodes skip flag */ private static void setTaskNodeSkip(String skipNodeCode, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList, Map<String, TaskNode> skipTaskNodeList) { if (!dag.containsNode(skipNodeCode)) { return;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
} skipTaskNodeList.putIfAbsent(skipNodeCode, dag.getNode(skipNodeCode)); Collection<String> postNodeList = dag.getSubsequentNodes(skipNodeCode); for (String post : postNodeList) { TaskNode postNode = dag.getNode(post); if (isTaskNodeNeedSkip(postNode, skipTaskNodeList)) { setTaskNodeSkip(post, dag, completeTaskList, skipTaskNodeList); } } } /*** * build dag graph * @param processDag processDag * @return dag */ public static DAG<String, TaskNode, TaskNodeRelation> buildDagGraph(ProcessDag processDag) { DAG<String, TaskNode, TaskNodeRelation> dag = new DAG<>(); if (CollectionUtils.isNotEmpty(processDag.getNodes())) { for (TaskNode node : processDag.getNodes()) { dag.addNode(Long.toString(node.getCode()), node); } } if (CollectionUtils.isNotEmpty(processDag.getEdges())) { for (TaskNodeRelation edge : processDag.getEdges()) { dag.addEdge(edge.getStartNode(), edge.getEndNode()); } } return dag;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
} /** * get process dag * * @param taskNodeList task node list * @return Process dag */ public static ProcessDag getProcessDag(List<TaskNode> taskNodeList) { List<TaskNodeRelation> taskNodeRelations = new ArrayList<>(); for (TaskNode taskNode : taskNodeList) { String preTasks = taskNode.getPreTasks(); List<String> preTasksList = JSONUtils.toList(preTasks, String.class); if (preTasksList != null) { for (String depNode : preTasksList) { taskNodeRelations.add(new TaskNodeRelation(depNode, Long.toString(taskNode.getCode()))); } } } ProcessDag processDag = new ProcessDag(); processDag.setEdges(taskNodeRelations); processDag.setNodes(taskNodeList); return processDag; } /** * get process dag * * @param taskNodeList task node list * @return Process dag
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
*/ public static ProcessDag getProcessDag(List<TaskNode> taskNodeList, List<ProcessTaskRelation> processTaskRelations) { Map<Long, TaskNode> taskNodeMap = new HashMap<>(); taskNodeList.forEach(taskNode -> { taskNodeMap.putIfAbsent(taskNode.getCode(), taskNode); }); List<TaskNodeRelation> taskNodeRelations = new ArrayList<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { long preTaskCode = processTaskRelation.getPreTaskCode(); long postTaskCode = processTaskRelation.getPostTaskCode(); if (processTaskRelation.getPreTaskCode() != 0 && taskNodeMap.containsKey(preTaskCode) && taskNodeMap.containsKey(postTaskCode)) { TaskNode preNode = taskNodeMap.get(preTaskCode); TaskNode postNode = taskNodeMap.get(postTaskCode); taskNodeRelations.add(new TaskNodeRelation(Long.toString(preNode.getCode()), Long.toString(postNode.getCode()))); } } ProcessDag processDag = new ProcessDag(); processDag.setEdges(taskNodeRelations); processDag.setNodes(taskNodeList); return processDag; } /** * is there have conditions after the parent node */ public static boolean haveConditionsAfterNode(String parentNodeCode, DAG<String, TaskNode, TaskNodeRelation> dag ) { boolean result = false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,657
[Bug] [Master] Failed to operate workflow node separately
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened ![image](https://user-images.githubusercontent.com/42203474/139636648-2b175530-996c-48bb-82ff-46b8a6ea39ba.png) Failed to operate workflow node alone. No new task instance is generated. version: dev There are no problems in the version of 2.0-alpha-release. ### What you expected to happen Operate workflow node separately and generate new task instance. ### How to reproduce Operate workflow node separately. ### Anything else ```java [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.452 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [a] is not in task node list [[TaskNode{id='null', code=851434614521856, version=1, name='a', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"a\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.dao.utils.DagHelper:[112] - start node name [job_b1] is not in task node list [[TaskNode{id='null', code=851435467538432, version=1, name='job_b1', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b1\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851437597130752, version=2, name='depend_a', desc='', type='DEPENDENT', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"waitStartTimeout":{"strategy":"FAILED","interval":null,"checkInterval":null,"enable":false},"switchResult":{}}', preTasks='[]', preTaskNodeList=null, extras='null', depList=[], dependence='{"relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"projectCode":851275541217280,"definitionCode":851435217125376,"depTasks":"a","cycle":"day","dateValue":"today"}]}]}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}, TaskNode{id='null', code=851436591874048, version=1, name='job_b2', desc='', type='SHELL', runFlag='NORMAL', loc='null', maxRetryTimes=0, retryInterval=1, params='{"resourceList":[],"localParams":[],"rawScript":"echo \"b2\"","waitStartTimeout":{},"switchResult":{}}', preTasks='[851437597130752]', preTaskNodeList=null, extras='null', depList=[851437597130752], dependence='{}', conditionResult='{"successNode":[""],"failedNode":[""]}', taskInstancePriority=MEDIUM, workerGroup='default', environmentCode=-1, timeout='{"enable":false,"strategy":null,"interval":0}', delayTime=0}]] [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.453 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[512] - processDag is null [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] 2021-11-01 15:30:35.454 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[195] - handler error: java.lang.NullPointerException: null at org.apache.dolphinscheduler.dao.utils.DagHelper.parsePostNodes(DagHelper.java:301) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.submitPostNode(WorkflowExecuteThread.java:797) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.startProcess(WorkflowExecuteThread.java:464) at org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread.run(WorkflowExecuteThread.java:192) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) ``` ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6657
https://github.com/apache/dolphinscheduler/pull/6717
a728c85a92faff6539daa86defa5206f986d38a9
69f2d3b21bc99006fd1fa4e0f0b970972d26ae2f
"2021-11-01T07:33:49Z"
java
"2021-11-06T11:27:00Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java
Set<String> subsequentNodes = dag.getSubsequentNodes(parentNodeCode); if (CollectionUtils.isEmpty(subsequentNodes)) { return result; } for (String nodeCode : subsequentNodes) { TaskNode taskNode = dag.getNode(nodeCode); List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class); if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) { return true; } } return result; } /** * is there have conditions after the parent node */ public static boolean haveConditionsAfterNode(String parentNodeCode, List<TaskNode> taskNodes) { if (CollectionUtils.isEmpty(taskNodes)) { return false; } for (TaskNode taskNode : taskNodes) { List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class); if (preTasksList.contains(parentNodeCode) && taskNode.isConditionsTask()) { return true; } } return false; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
*/ package org.apache.dolphinscheduler.server.master.dispatch.host; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.HeartBeat; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory; import org.apache.dolphinscheduler.server.master.dispatch.context.ExecutionContext; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.HostWeight; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.HostWorker; import org.apache.dolphinscheduler.server.master.dispatch.host.assign.LowerWeightRoundRobin; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * lower weight host manager */ public class LowerWeightHostManager extends CommonHostManager {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
private final Logger logger = LoggerFactory.getLogger(LowerWeightHostManager.class); /** * selector */ private LowerWeightRoundRobin selector; /** * worker host weights */ private ConcurrentHashMap<String, Set<HostWeight>> workerHostWeightsMap; /** * worker group host lock */ private Lock lock; /** * executor service */ private ScheduledExecutorService executorService; @PostConstruct public void init() { this.selector = new LowerWeightRoundRobin(); this.workerHostWeightsMap = new ConcurrentHashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
this.lock = new ReentrantLock(); this.executorService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LowerWeightHostManagerExecutor")); this.executorService.scheduleWithFixedDelay(new RefreshResourceTask(), 0, 1, TimeUnit.SECONDS); } @PreDestroy public void close() { this.executorService.shutdownNow(); } /** * select host * * @param context context * @return host */ @Override public Host select(ExecutionContext context) { Set<HostWeight> workerHostWeights = getWorkerHostWeights(context.getWorkerGroup()); if (CollectionUtils.isNotEmpty(workerHostWeights)) { return selector.select(workerHostWeights).getHost(); } return new Host(); } @Override public HostWorker select(Collection<HostWorker> nodes) { throw new UnsupportedOperationException("not support"); } private void syncWorkerHostWeight(Map<String, Set<HostWeight>> workerHostWeights) { lock.lock(); try { workerHostWeightsMap.clear();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
workerHostWeightsMap.putAll(workerHostWeights); } finally { lock.unlock(); } } private Set<HostWeight> getWorkerHostWeights(String workerGroup) { lock.lock(); try { return workerHostWeightsMap.get(workerGroup); } finally { lock.unlock(); } } class RefreshResourceTask implements Runnable { @Override public void run() { try { Map<String, Set<HostWeight>> workerHostWeights = new HashMap<>(); Map<String, Set<String>> workerGroupNodes = serverNodeManager.getWorkerGroupNodes(); for (Map.Entry<String, Set<String>> entry : workerGroupNodes.entrySet()) { String workerGroup = entry.getKey(); Set<String> nodes = entry.getValue(); Set<HostWeight> hostWeights = new HashSet<>(nodes.size()); for (String node : nodes) { String heartbeat = serverNodeManager.getWorkerNodeInfo(node); HostWeight hostWeight = getHostWeight(node, workerGroup, heartbeat); if (hostWeight != null) { hostWeights.add(hostWeight); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,641
[Bug] [MasterServer] RefreshResourceTask error by NPE
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened When master refresh the worker node, it may occur NPE when hearbeat is null. ``` [ERROR] 2021-10-29 20:21:45.977 org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager:[152] - [] RefreshResourceTask error java.lang.NullPointerException: null at org.apache.dolphinscheduler.common.utils.HeartBeat.decodeHeartBeat(HeartBeat.java:228) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.getHostWeight(LowerWeightHostManager.java:157) at org.apache.dolphinscheduler.server.master.dispatch.host.LowerWeightHostManager$RefreshResourceTask.run(LowerWeightHostManager.java:141) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ### What you expected to happen No NPE Excetion. ### How to reproduce Restart the worker server. ### Anything else _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6641
https://github.com/apache/dolphinscheduler/pull/6656
b226253eec219bc0152ed5a3c5939e13385bcedc
73f20b7553565f3d8d1ac2640d8806191fc17666
"2021-10-29T12:48:29Z"
java
"2021-11-07T03:40:54Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/dispatch/host/LowerWeightHostManager.java
if (!hostWeights.isEmpty()) { workerHostWeights.put(workerGroup, hostWeights); } } syncWorkerHostWeight(workerHostWeights); } catch (Throwable ex) { logger.error("RefreshResourceTask error", ex); } } public HostWeight getHostWeight(String addr, String workerGroup, String heartBeatInfo) { HeartBeat heartBeat = HeartBeat.decodeHeartBeat(heartBeatInfo); if (heartBeat == null) { return null; } if (Constants.ABNORMAL_NODE_STATUS == heartBeat.getServerStatus()) { logger.warn("worker {} current cpu load average {} is too high or available memory {}G is too low", addr, heartBeat.getLoadAverage(), heartBeat.getAvailablePhysicalMemorySize()); return null; } if (Constants.BUSY_NODE_STATUE == heartBeat.getServerStatus()) { logger.warn("worker {} is busy, current waiting task count {} is large than worker thread count {}", addr, heartBeat.getWorkerWaitingTaskCount(), heartBeat.getWorkerExecThreadCount()); return null; } return new HostWeight(HostWorker.of(addr, heartBeat.getWorkerHostWeight(), workerGroup), heartBeat.getCpuUsage(), heartBeat.getMemoryUsage(), heartBeat.getLoadAverage(), heartBeat.getStartupTime()); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/* * Lcensed to the Apache Software Foundaton (ASF) under one or more * contrbutor lcense agreements. See the NOTICE fle dstrbuted wth * ths work for addtonal nformaton regardng copyrght ownershp. * The ASF lcenses ths fle to You under the Apache Lcense, Verson 2.0 * (the "Lcense"); you may not use ths fle except n complance wth * the Lcense. You may obtan a copy of the Lcense at * * http://www.apache.org/lcenses/LICENSE-2.0 * * Unless requred by applcable law or agreed to n wrtng, software * dstrbuted under the Lcense s dstrbuted on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ether express or mpled. * See the Lcense for the specfc language governng permssons and
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
* lmtatons under the Lcense. */ package org.apache.dolphnscheduler.server.master.runner; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; mport statc org.apache.dolphnscheduler.common.Constants.CMD_PARAM_START_NODES; mport statc org.apache.dolphnscheduler.common.Constants.DEFAULT_WORKER_GROUP; mport org.apache.dolphnscheduler.common.Constants; mport org.apache.dolphnscheduler.common.enums.CommandType; mport org.apache.dolphnscheduler.common.enums.DependResult; mport org.apache.dolphnscheduler.common.enums.Drect; mport org.apache.dolphnscheduler.common.enums.ExecutonStatus; mport org.apache.dolphnscheduler.common.enums.FalureStrategy; mport org.apache.dolphnscheduler.common.enums.Flag; mport org.apache.dolphnscheduler.common.enums.Prorty; mport org.apache.dolphnscheduler.common.enums.StateEvent; mport org.apache.dolphnscheduler.common.enums.StateEventType; mport org.apache.dolphnscheduler.common.enums.TaskDependType; mport org.apache.dolphnscheduler.common.enums.TaskTmeoutStrategy; mport org.apache.dolphnscheduler.common.enums.TmeoutFlag; mport org.apache.dolphnscheduler.common.graph.DAG; mport org.apache.dolphnscheduler.common.model.TaskNode; mport org.apache.dolphnscheduler.common.model.TaskNodeRelaton; mport org.apache.dolphnscheduler.common.process.ProcessDag; mport org.apache.dolphnscheduler.common.process.Property; mport org.apache.dolphnscheduler.common.thread.ThreadUtls; mport org.apache.dolphnscheduler.common.utls.CollectonUtls; mport org.apache.dolphnscheduler.common.utls.DateUtls;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport org.apache.dolphnscheduler.common.utls.JSONUtls; mport org.apache.dolphnscheduler.common.utls.NetUtls; mport org.apache.dolphnscheduler.common.utls.ParameterUtls; mport org.apache.dolphnscheduler.dao.entty.Command; mport org.apache.dolphnscheduler.dao.entty.Envronment; mport org.apache.dolphnscheduler.dao.entty.ProcessDefnton; mport org.apache.dolphnscheduler.dao.entty.ProcessInstance; mport org.apache.dolphnscheduler.dao.entty.ProjectUser; mport org.apache.dolphnscheduler.dao.entty.Schedule; mport org.apache.dolphnscheduler.dao.entty.TaskDefnton; mport org.apache.dolphnscheduler.dao.entty.TaskInstance; mport org.apache.dolphnscheduler.dao.utls.DagHelper; mport org.apache.dolphnscheduler.remote.command.HostUpdateCommand; mport org.apache.dolphnscheduler.remote.utls.Host; mport org.apache.dolphnscheduler.server.master.confg.MasterConfg; mport org.apache.dolphnscheduler.server.master.dspatch.executor.NettyExecutorManager; mport org.apache.dolphnscheduler.server.master.runner.task.ITaskProcessor; mport org.apache.dolphnscheduler.server.master.runner.task.TaskActon; mport org.apache.dolphnscheduler.server.master.runner.task.TaskProcessorFactory; mport org.apache.dolphnscheduler.servce.alert.ProcessAlertManager; mport org.apache.dolphnscheduler.servce.process.ProcessServce; mport org.apache.dolphnscheduler.servce.quartz.cron.CronUtls; mport org.apache.dolphnscheduler.servce.queue.PeerTaskInstancePrortyQueue; mport org.apache.commons.lang.StrngUtls; mport java.utl.ArrayLst; mport java.utl.Arrays; mport java.utl.Collecton; mport java.utl.Date; mport java.utl.HashMap; mport java.utl.Iterator;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
mport java.utl.Lst; mport java.utl.Map; mport java.utl.Objects; mport java.utl.Set; mport java.utl.concurrent.ConcurrentHashMap; mport java.utl.concurrent.ConcurrentLnkedQueue; mport java.utl.concurrent.ExecutorServce; mport org.slf4j.Logger; mport org.slf4j.LoggerFactory; mport com.google.common.collect.HashBasedTable; mport com.google.common.collect.Lsts; mport com.google.common.collect.Table; /** * master exec thread,splt dag */ publc class WorkflowExecuteThread mplements Runnable { /** * logger of WorkflowExecuteThread */ prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteThread.class); /** * runng TaskNode */ prvate fnal Map<Integer, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>(); /** * task exec servce */ prvate fnal ExecutorServce taskExecServce; /** * process nstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
*/ prvate ProcessInstance processInstance; /** * submt falure nodes */ prvate boolean taskFaledSubmt = false; /** * recover node d lst */ prvate Lst<TaskInstance> recoverNodeIdLst = new ArrayLst<>(); /** * error task lst */ prvate Map<Strng, TaskInstance> errorTaskLst = new ConcurrentHashMap<>(); /** * complete task lst */ prvate Map<Strng, TaskInstance> completeTaskLst = new ConcurrentHashMap<>(); /** * ready to submt task queue */ prvate PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue(); /** * depend faled task map */ prvate Map<Strng, TaskInstance> dependFaledTask = new ConcurrentHashMap<>(); /** * forbdden task map */ prvate Map<Strng, TaskNode> forbddenTaskLst = new ConcurrentHashMap<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
/** * skp task map */ prvate Map<Strng, TaskNode> skpTaskNodeLst = new ConcurrentHashMap<>(); /** * recover tolerance fault task lst */ prvate Lst<TaskInstance> recoverToleranceFaultTaskLst = new ArrayLst<>(); /** * alert manager */ prvate ProcessAlertManager processAlertManager; /** * the object of DAG */ prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag; /** * process servce */ prvate ProcessServce processServce; /** * master confg */ prvate MasterConfg masterConfg; /** * */ prvate NettyExecutorManager nettyExecutorManager; prvate ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>(); prvate Lst<Date> complementLstDate = Lsts.newLnkedLst();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate Table<Integer, Long, TaskInstance> taskInstanceHashMap = HashBasedTable.create(); prvate ProcessDefnton processDefnton; prvate Strng key; prvate ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst; /** * start flag, true: start nodes submt completely * */ prvate boolean sStart = false; /** * constructor of WorkflowExecuteThread * * @param processInstance processInstance * @param processServce processServce * @param nettyExecutorManager nettyExecutorManager * @param taskTmeoutCheckLst */ publc WorkflowExecuteThread(ProcessInstance processInstance , ProcessServce processServce , NettyExecutorManager nettyExecutorManager , ProcessAlertManager processAlertManager , MasterConfg masterConfg , ConcurrentHashMap<Integer, TaskInstance> taskTmeoutCheckLst) { ths.processServce = processServce; ths.processInstance = processInstance; ths.masterConfg = masterConfg; nt masterTaskExecNum = masterConfg.getMasterExecTaskNum(); ths.taskExecServce = ThreadUtls.newDaemonFxedThreadExecutor("Master-Task-Exec-Thread", masterTaskExecNum); ths.nettyExecutorManager = nettyExecutorManager;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
ths.processAlertManager = processAlertManager; ths.taskTmeoutCheckLst = taskTmeoutCheckLst; } @Overrde publc vod run() { try { startProcess(); handleEvents(); } catch (Excepton e) { logger.error("handler error:", e); } } /** * the process start nodes are submtted completely. * @return */ publc boolean sStart() { return ths.sStart; } prvate vod handleEvents() { whle (ths.stateEvents.sze() > 0) { try { StateEvent stateEvent = ths.stateEvents.peek(); f (stateEventHandler(stateEvent)) { ths.stateEvents.remove(stateEvent); } } catch (Excepton e) { logger.error("state handle error:", e); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} publc Strng getKey() { f (StrngUtls.sNotEmpty(key) || ths.processDefnton == null) { return key; } key = Strng.format("%d_%d_%d", ths.processDefnton.getCode(), ths.processDefnton.getVerson(), ths.processInstance.getId()); return key; } publc boolean addStateEvent(StateEvent stateEvent) { f (processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.nfo("state event would be abounded :{}", stateEvent.toStrng()); return false; } ths.stateEvents.add(stateEvent); return true; } publc nt eventSze() { return ths.stateEvents.sze(); } publc ProcessInstance getProcessInstance() { return ths.processInstance; } prvate boolean stateEventHandler(StateEvent stateEvent) { logger.nfo("process event: {}", stateEvent.toStrng()); f (!checkStateEvent(stateEvent)) { return false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
} boolean result = false; swtch (stateEvent.getType()) { case PROCESS_STATE_CHANGE: result = processStateChangeHandler(stateEvent); break; case TASK_STATE_CHANGE: result = taskStateChangeHandler(stateEvent); break; case PROCESS_TIMEOUT: result = processTmeout(); break; case TASK_TIMEOUT: result = taskTmeout(stateEvent); break; default: break; } f (result) { ths.stateEvents.remove(stateEvent); } return result; } prvate boolean taskTmeout(StateEvent stateEvent) { f (taskInstanceHashMap.contansRow(stateEvent.getTaskInstanceId())) { return true; } TaskInstance taskInstance = taskInstanceHashMap .row(stateEvent.getTaskInstanceId()) .values()
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
.terator().next(); f (TmeoutFlag.CLOSE == taskInstance.getTaskDefne().getTmeoutFlag()) { return true; } TaskTmeoutStrategy taskTmeoutStrategy = taskInstance.getTaskDefne().getTmeoutNotfyStrategy(); f (TaskTmeoutStrategy.FAILED == taskTmeoutStrategy) { ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); taskProcessor.acton(TaskActon.TIMEOUT); return false; } else { processAlertManager.sendTaskTmeoutAlert(processInstance, taskInstance, taskInstance.getTaskDefne()); return true; } } prvate boolean processTmeout() { ths.processAlertManager.sendProcessTmeoutAlert(ths.processInstance, ths.processDefnton); return true; } prvate boolean taskStateChangeHandler(StateEvent stateEvent) { TaskInstance task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId()); f (task.getState().typeIsFnshed()) { taskFnshed(task); } else f (actveTaskProcessorMaps.contansKey(stateEvent.getTaskInstanceId())) { ITaskProcessor TaskProcessor = actveTaskProcessorMaps.get(stateEvent.getTaskInstanceId()); TaskProcessor.run(); f (TaskProcessor.taskState().typeIsFnshed()) { task = processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId()); taskFnshed(task); } } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
logger.error("state handler error: {}", stateEvent.toStrng()); } return true; } prvate vod taskFnshed(TaskInstance task) { logger.nfo("work flow {} task {} state:{} ", processInstance.getId(), task.getId(), task.getState()); f (task.taskCanRetry()) { addTaskToStandByLst(task); f (!task.retryTaskIntervalOverTme()) { logger.nfo("falure task wll be submtted: process d: {}, task nstance d: {} state:{} retry tmes:{} / {}, nterval:{}", processInstance.getId(), task.getId(), task.getState(), task.getRetryTmes(), task.getMaxRetryTmes(), task.getRetryInterval()); ths.addTmeoutCheck(task); } else { submtStandByTask(); } return; } ProcessInstance processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); completeTaskLst.put(Long.toStrng(task.getTaskCode()), task); actveTaskProcessorMaps.remove(task.getId()); taskTmeoutCheckLst.remove(task.getId()); f (task.getState().typeIsSuccess()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
processInstance.setVarPool(task.getVarPool()); processServce.saveProcessInstance(processInstance); submtPostNode(Long.toStrng(task.getTaskCode())); } else f (task.getState().typeIsFalure()) { f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) { submtPostNode(Long.toStrng(task.getTaskCode())); } else { errorTaskLst.put(Long.toStrng(task.getTaskCode()), task); f (processInstance.getFalureStrategy() == FalureStrategy.END) { kllAllTasks(); } } } ths.updateProcessInstanceState(); } prvate boolean checkStateEvent(StateEvent stateEvent) { f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) { logger.error("msmatch process nstance d: {}, state event:{}", ths.processInstance.getId(), stateEvent.toStrng()); return false; } return true; } prvate boolean processStateChangeHandler(StateEvent stateEvent) { try { logger.nfo("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutonStatus()); processInstance = processServce.fndProcessInstanceById(ths.processInstance.getId()); f (processComplementData()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return true; } f (stateEvent.getExecutonStatus().typeIsFnshed()) { endProcess(); } f (processInstance.getState() == ExecutonStatus.READY_STOP) { kllAllTasks(); } return true; } catch (Excepton e) { logger.error("process state change error:", e); } return true; } prvate boolean processComplementData() throws Excepton { f (!needComplementProcess()) { return false; } Date scheduleDate = processInstance.getScheduleTme(); f (scheduleDate == null) { scheduleDate = complementLstDate.get(0); } else f (processInstance.getState().typeIsFnshed()) { endProcess(); f (complementLstDate.sze() <= 0) { logger.nfo("process complement end. process d:{}", processInstance.getId()); return true; } nt ndex = complementLstDate.ndexOf(scheduleDate); f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().typeIsSuccess()) { logger.nfo("process complement end. process d:{}", processInstance.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
return true; } logger.nfo("process complement contnue. process d:{}, schedule tme:{} complementLstDate:{}", processInstance.getId(), processInstance.getScheduleTme(), complementLstDate.toStrng()); scheduleDate = complementLstDate.get(ndex + 1); processInstance.setId(0); } processInstance.setScheduleTme(scheduleDate); Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam()); f (cmdParam.contansKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); processInstance.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); } processInstance.setState(ExecutonStatus.RUNNING_EXECUTION); processInstance.setGlobalParams(ParameterUtls.curngGlobalParams( processDefnton.getGlobalParamMap(), processDefnton.getGlobalParamLst(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme())); processInstance.setStartTme(new Date()); processInstance.setEndTme(null); processServce.saveProcessInstance(processInstance); ths.taskInstanceHashMap.clear(); startProcess(); return true; } prvate boolean needComplementProcess() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
f (processInstance.sComplementData() && Flag.NO == processInstance.getIsSubProcess()) { return true; } return false; } prvate vod startProcess() throws Excepton { f (ths.taskInstanceHashMap.sze() == 0) { sStart = false; buldFlowDag(); ntTaskQueue(); submtPostNode(null); sStart = true; } } /** * process end handle */ prvate vod endProcess() { ths.stateEvents.clear(); processInstance.setEndTme(new Date()); ProcessDefnton processDefnton = ths.processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(),processInstance.getProcessDefntonVerson()); f (processDefnton.getExecutonType().typeIsSeralWat()) { checkSeralProcess(processDefnton); } processServce.updateProcessInstance(processInstance); f (processInstance.getState().typeIsWatngThread()) { processServce.createRecoveryWatngThreadCommand(null, processInstance); } Lst<TaskInstance> taskInstances = processServce.fndValdTaskLstByProcessId(processInstance.getId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId()); processAlertManager.sendAlertProcessInstance(processInstance, taskInstances, projectUser); } publc vod checkSeralProcess(ProcessDefnton processDefnton) { ths.processInstance = processServce.fndProcessInstanceById(processInstance.getId()); nt nextInstanceId = processInstance.getNextProcessInstanceId(); f (nextInstanceId == 0) { ProcessInstance nextProcessInstance = ths.processServce.loadNextProcess4Seral(processInstance.getProcessDefnton().getCode(),ExecutonStatus.SERIAL_WAIT.getCode()); f (nextProcessInstance == null) { return; } nextInstanceId = nextProcessInstance.getId(); } ProcessInstance nextProcessInstance = ths.processServce.fndProcessInstanceById(nextInstanceId); f (nextProcessInstance.getState().typeIsFnshed() || nextProcessInstance.getState().typeIsRunnng()) { return; } Map<Strng, Object> cmdParam = new HashMap<>(); cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, nextInstanceId); Command command = new Command(); command.setCommandType(CommandType.RECOVER_SERIAL_WAIT); command.setProcessDefntonCode(processDefnton.getCode()); command.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); processServce.createCommand(command); } /** * generate process dag * * @throws Excepton excepton */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
6,737
[Bug] [MasterServer] Event handle twice in two thread pool
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened branch: 2.0 ``` [INFO] 2021-11-08 15:55:48.889 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.911 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 865, event type: SUCCESS [INFO] 2021-11-08 15:55:48.920 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.929 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 866, event type: SUCCESS [INFO] 2021-11-08 15:55:48.936 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.942 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 867, event type: SUCCESS [INFO] 2021-11-08 15:55:48.948 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.956 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.963 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 868, event type: SUCCESS [INFO] 2021-11-08 15:55:48.966 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.969 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.975 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 869, event type: SUCCESS [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.009 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 871, event type: RUNNING_EXECUTION ``` from the log, can see that task id 870 has 4 event, 2 RUNNING_EXECUTION and 2 SUCCESS; grep 870 from the log ``` [INFO] 2021-11-08 15:55:48.844 org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor:[120] - task ready to submit: TaskInstance{id=870, name='parallel_01', taskType='SHELL', processInstanceId=741, processInstanceName='null', state=SUBMITTED_SUCCESS, firstSubmitTime=Mon Nov 08 15:55:48 CST 2021, submitTime=Mon Nov 08 15:55:48 CST 2021, startTime=null, endTime=null, host='null', executePath='null', logPath='null', retryTimes=0, alertFlag=NO, processInstance=null, processDefine=null, pid=0, appLink='null', flag=YES, dependency='null', duration=null, maxRetryTimes=0, retryInterval=1, taskInstancePriority=MEDIUM, processInstancePriority=MEDIUM, dependentResult='null', workerGroup='default', environmentCode=-1, environmentConfig='null', executorId=1, executorName='null', delayTime=0, dryRun=0} [INFO] 2021-11-08 15:55:48.856 org.apache.dolphinscheduler.server.master.processor.TaskAckProcessor:[79] - taskAckCommand : TaskExecuteAckCommand{taskInstanceId=870, startTime=Mon Nov 08 15:55:48 CST 2021, host='192.168.31.239:1234', status=1, logPath='/home/csf/javapath/dolphinscheduler/logs/882302276001792_1/741/870.log', executePath='/tmp/dolphinscheduler/exec/process/854201280159744/882302276001792_1/741/870', processInstanceId='741'} [INFO] 2021-11-08 15:55:48.858 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[1163] - remove task from stand by list, id: 870 name:parallel_01 [INFO] 2021-11-08 15:55:48.874 org.apache.dolphinscheduler.server.master.processor.TaskResponseProcessor:[80] - received command : TaskExecuteResponseCommand{taskInstanceId=870, status=7, endTime=Mon Nov 08 15:55:48 CST 2021, processId=6637, appIds=''} [INFO] 2021-11-08 15:55:48.982 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: RUNNING_EXECUTION [INFO] 2021-11-08 15:55:48.986 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.988 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:48.994 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:MasterEventExecution, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:48.995 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS [INFO] 2021-11-08 15:55:49.007 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[291] - handleEvent current Thread:Master-Exec-Thread, process id: 741, task id: 870, event type: SUCCESS [INFO] 2021-11-08 15:55:49.008 org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[370] - work flow 741 task 870 state:SUCCESS ``` ### What you expected to happen Each event is processed only once ### How to reproduce Create parallel tasks and reduce the master threads. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
https://github.com/apache/dolphinscheduler/issues/6737
https://github.com/apache/dolphinscheduler/pull/6738
bdea8d6ae4e35d64686d97f606b1e235f9664dbe
b6824b47419a5abc7ab4279d648417249a74f122
"2021-11-08T08:11:35Z"
java
"2021-11-08T08:54:58Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
prvate vod buldFlowDag() throws Excepton { f (ths.dag != null) { return; } processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(), processInstance.getProcessDefntonVerson()); recoverNodeIdLst = getStartTaskInstanceLst(processInstance.getCommandParam()); Lst<TaskNode> taskNodeLst = processServce.transformTask(processServce.fndRelatonByCode(processDefnton.getProjectCode(), processDefnton.getCode()), Lsts.newArrayLst()); forbddenTaskLst.clear(); taskNodeLst.forEach(taskNode -> { f (taskNode.sForbdden()) { forbddenTaskLst.put(Long.toStrng(taskNode.getCode()), taskNode); } }); Lst<Strng> recoveryNodeCodeLst = getRecoveryNodeCodeLst(); Lst<Strng> startNodeNameLst = parseStartNodeName(processInstance.getCommandParam()); ProcessDag processDag = generateFlowDag(taskNodeLst, startNodeNameLst, recoveryNodeCodeLst, processInstance.getTaskDependType()); f (processDag == null) { logger.error("processDag s null"); return; } dag = DagHelper.buldDagGraph(processDag); } /** * nt task queue */