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
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,892 | [Bug] [api] When a non-admin user creates a udf function, resources other than .jar will be displayed in the UDF resource | ### 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
1. When a non-admin user has authorized other resources, when creating a udf function, the UDF resource will display non `.jar` resources

2. UDF resource displays correctly when creating user with admin user
### What you expected to happen
It is wrong to display non-.jar resources in UDF resources
### How to reproduce
step1: Authorize some resources to user a under the administrator user
step2: Log in with user a, and create or modify UDF functions, UDF resources display non `.jar` resources
### Anything else
Discovered by looking at the code
In the `org.apache.dolphinscheduler.api.service.impl.ResourcesServiceImpl#queryAuthoredResourceList` code, when querying UDF resources, the `t_ds_relation_udfs_user` table is not filtered by type, but the `t_ds_relation_resources_user` table is directly queried

### Version
2.0.1
### 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/7892 | https://github.com/apache/dolphinscheduler/pull/8458 | b92f6d876d41c7e419572ac9ced3d0aad895d293 | 1ffb5d6e8d6512ee0be958069e8bbd1c105b2989 | 2022-01-08T03:49:51Z | java | 2022-02-24T10:17:25Z | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java | List<UdfFunc> udfFuncs = new ArrayList<>();
udfFuncs.add(getUdfFunc(1));
udfFuncs.add(getUdfFunc(2));
udfFuncs.add(getUdfFunc(3));
return udfFuncs;
}
private List<UdfFunc> getSingleUdfFuncList() {
return Collections.singletonList(getUdfFunc(3));
}
private User getUser() {
User user = new User();
user.setId(1);
user.setTenantId(1);
return user;
}
private List<String> getContent() {
List<String> contentList = new ArrayList<>();
contentList.add("test");
return contentList;
}
private List<Map<String, Object>> getResources() {
List<Map<String, Object>> resources = new ArrayList<>();
Map<String, Object> resource = new HashMap<>();
resource.put("id", 1);
resource.put("resource_ids", "1");
resources.add(resource);
return resources;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,513 | [Upgrade] Upgrade mybatis-plus to 3.4.3 | ### Discussed in https://github.com/apache/dolphinscheduler/discussions/8162
<div type='discussions-op-text'>
<sup>Originally posted by **YiuTerran** January 24, 2022</sup>
Mybatis-plus v3.2.0 using mybatis 3.5.2.
There are high level security problems for this version. See [CVE-2020-26945](https://nvd.nist.gov/vuln/detail/CVE-2020-26945)</div> | https://github.com/apache/dolphinscheduler/issues/8513 | https://github.com/apache/dolphinscheduler/pull/8515 | 33b50bab7232434a7ac5787b20f4e08db69a7d95 | ca6d148a1b48195a359a3ab29d449229a87dd05a | 2022-02-24T03:07:16Z | java | 2022-02-25T00:31:12Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.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.dao.datasource;
import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,513 | [Upgrade] Upgrade mybatis-plus to 3.4.3 | ### Discussed in https://github.com/apache/dolphinscheduler/discussions/8162
<div type='discussions-op-text'>
<sup>Originally posted by **YiuTerran** January 24, 2022</sup>
Mybatis-plus v3.2.0 using mybatis 3.5.2.
There are high level security problems for this version. See [CVE-2020-26945](https://nvd.nist.gov/vuln/detail/CVE-2020-26945)</div> | https://github.com/apache/dolphinscheduler/issues/8513 | https://github.com/apache/dolphinscheduler/pull/8515 | 33b50bab7232434a7ac5787b20f4e08db69a7d95 | ca6d148a1b48195a359a3ab29d449229a87dd05a | 2022-02-24T03:07:16Z | java | 2022-02-25T00:31:12Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java | import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.type.JdbcType;
import java.util.Properties;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
@Configuration
public class SpringConnectionFactory {
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
@Bean
public DataSourceTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
MybatisConfiguration configuration = new MybatisConfiguration();
configuration.setMapUnderscoreToCamelCase(true);
configuration.setCacheEnabled(false);
configuration.setCallSettersOnNulls(true); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,513 | [Upgrade] Upgrade mybatis-plus to 3.4.3 | ### Discussed in https://github.com/apache/dolphinscheduler/discussions/8162
<div type='discussions-op-text'>
<sup>Originally posted by **YiuTerran** January 24, 2022</sup>
Mybatis-plus v3.2.0 using mybatis 3.5.2.
There are high level security problems for this version. See [CVE-2020-26945](https://nvd.nist.gov/vuln/detail/CVE-2020-26945)</div> | https://github.com/apache/dolphinscheduler/issues/8513 | https://github.com/apache/dolphinscheduler/pull/8515 | 33b50bab7232434a7ac5787b20f4e08db69a7d95 | ca6d148a1b48195a359a3ab29d449229a87dd05a | 2022-02-24T03:07:16Z | java | 2022-02-25T00:31:12Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java | configuration.setJdbcTypeForNull(JdbcType.NULL);
configuration.addInterceptor(paginationInterceptor());
configuration.setGlobalConfig(new GlobalConfig().setBanner(false));
MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
sqlSessionFactoryBean.setConfiguration(configuration);
sqlSessionFactoryBean.setDataSource(dataSource);
GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig();
dbConfig.setIdType(IdType.AUTO);
GlobalConfig globalConfig = new GlobalConfig().setBanner(false);
globalConfig.setDbConfig(dbConfig);
sqlSessionFactoryBean.setGlobalConfig(globalConfig);
sqlSessionFactoryBean.setTypeAliasesPackage("org.apache.dolphinscheduler.dao.entity");
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
sqlSessionFactoryBean.setMapperLocations(resolver.getResources("org/apache/dolphinscheduler/dao/mapper/*Mapper.xml"));
sqlSessionFactoryBean.setTypeEnumsPackage("org.apache.dolphinscheduler.*.enums");
sqlSessionFactoryBean.setDatabaseIdProvider(databaseIdProvider());
return sqlSessionFactoryBean.getObject();
}
@Bean
public DatabaseIdProvider databaseIdProvider() {
DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
Properties properties = new Properties();
properties.setProperty("MySQL", "mysql");
properties.setProperty("PostgreSQL", "pg");
properties.setProperty("h2", "h2");
databaseIdProvider.setProperties(properties);
return databaseIdProvider;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,394 | [Bug] [Worker] when the data is supplemented still date+1 | ### 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
I see the 2.0.2-release note, [Feature-7451][Worker]remove date+1 when the data is supplemented.
But i use 2.0.3, when COMPLEMENT DATA the date still date+1:
**run the process(have one shell task, just print the date)**
<img width="716" alt="image" src="https://user-images.githubusercontent.com/48642743/154092379-98e96c05-e325-49c9-9841-647ff16d325e.png">
<img width="617" alt="image" src="https://user-images.githubusercontent.com/48642743/154092060-b68dee0d-3313-4daf-b149-3c321ef8136f.png">
**result**
```
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220201
20220202
20220202000000
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
......
[INFO] 2022-02-15 23:26:42.833 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220202
20220203
20220203000000
[INFO] 2022-02-15 23:26:42.835 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
```
### What you expected to happen
i think it will print like this ?
```
20220131
20220101
20220201000000
```
and
```
20220201
20220202
20220202000000
```
### How to reproduce
just like pictrue to do
### Anything else
i show the change from [#7452](https://github.com/apache/dolphinscheduler/pull/7452/commits/1c2371f57be0e4b317e44c1f95d7ff4a0758d4a6)
but, i think it's not in WokerServer, i think it's in MasterServer `BusinessTimeUtils.getBusinessTime(CommandType commandType, Date runTime)`
<img width="888" alt="image" src="https://user-images.githubusercontent.com/48642743/154096291-72dd0cf4-62e2-456c-98d5-a47750b3b420.png">
### Version
2.0.3
### 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/8394 | https://github.com/apache/dolphinscheduler/pull/8532 | ca6d148a1b48195a359a3ab29d449229a87dd05a | e174d7a40ef8326d698701e97fe347fd730f1277 | 2022-02-15T15:42:21Z | java | 2022-02-25T02:27:08Z | dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/paramparser/BusinessTimeUtils.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. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,394 | [Bug] [Worker] when the data is supplemented still date+1 | ### 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
I see the 2.0.2-release note, [Feature-7451][Worker]remove date+1 when the data is supplemented.
But i use 2.0.3, when COMPLEMENT DATA the date still date+1:
**run the process(have one shell task, just print the date)**
<img width="716" alt="image" src="https://user-images.githubusercontent.com/48642743/154092379-98e96c05-e325-49c9-9841-647ff16d325e.png">
<img width="617" alt="image" src="https://user-images.githubusercontent.com/48642743/154092060-b68dee0d-3313-4daf-b149-3c321ef8136f.png">
**result**
```
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220201
20220202
20220202000000
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
......
[INFO] 2022-02-15 23:26:42.833 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220202
20220203
20220203000000
[INFO] 2022-02-15 23:26:42.835 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
```
### What you expected to happen
i think it will print like this ?
```
20220131
20220101
20220201000000
```
and
```
20220201
20220202
20220202000000
```
### How to reproduce
just like pictrue to do
### Anything else
i show the change from [#7452](https://github.com/apache/dolphinscheduler/pull/7452/commits/1c2371f57be0e4b317e44c1f95d7ff4a0758d4a6)
but, i think it's not in WokerServer, i think it's in MasterServer `BusinessTimeUtils.getBusinessTime(CommandType commandType, Date runTime)`
<img width="888" alt="image" src="https://user-images.githubusercontent.com/48642743/154096291-72dd0cf4-62e2-456c-98d5-a47750b3b420.png">
### Version
2.0.3
### 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/8394 | https://github.com/apache/dolphinscheduler/pull/8532 | ca6d148a1b48195a359a3ab29d449229a87dd05a | e174d7a40ef8326d698701e97fe347fd730f1277 | 2022-02-15T15:42:21Z | java | 2022-02-25T02:27:08Z | dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/paramparser/BusinessTimeUtils.java | * See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.spi.task.paramparser;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.PARAMETER_BUSINESS_DATE;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.PARAMETER_CURRENT_DATE;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.PARAMETER_DATETIME;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.PARAMETER_FORMAT_DATE;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.PARAMETER_FORMAT_TIME;
import static org.apache.dolphinscheduler.spi.utils.DateUtils.addDays;
import static org.apache.dolphinscheduler.spi.utils.DateUtils.format;
import org.apache.dolphinscheduler.spi.enums.CommandType;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* business time utils
*/
public class BusinessTimeUtils {
private BusinessTimeUtils() {
throw new IllegalStateException("BusinessTimeUtils class");
}
/**
* get business time in parameters by different command types
*
* @param commandType command type
* @param runTime run time or schedule time
* @return business time
*/
public static Map<String, String> getBusinessTime(CommandType commandType, Date runTime) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,394 | [Bug] [Worker] when the data is supplemented still date+1 | ### 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
I see the 2.0.2-release note, [Feature-7451][Worker]remove date+1 when the data is supplemented.
But i use 2.0.3, when COMPLEMENT DATA the date still date+1:
**run the process(have one shell task, just print the date)**
<img width="716" alt="image" src="https://user-images.githubusercontent.com/48642743/154092379-98e96c05-e325-49c9-9841-647ff16d325e.png">
<img width="617" alt="image" src="https://user-images.githubusercontent.com/48642743/154092060-b68dee0d-3313-4daf-b149-3c321ef8136f.png">
**result**
```
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220201
20220202
20220202000000
[INFO] 2022-02-15 23:26:41.602 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
......
[INFO] 2022-02-15 23:26:42.833 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[66] - -> welcome to use bigdata scheduling system...
20220202
20220203
20220203000000
[INFO] 2022-02-15 23:26:42.835 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.shell.ShellTask:[60] - FINALIZE_SESSION
```
### What you expected to happen
i think it will print like this ?
```
20220131
20220101
20220201000000
```
and
```
20220201
20220202
20220202000000
```
### How to reproduce
just like pictrue to do
### Anything else
i show the change from [#7452](https://github.com/apache/dolphinscheduler/pull/7452/commits/1c2371f57be0e4b317e44c1f95d7ff4a0758d4a6)
but, i think it's not in WokerServer, i think it's in MasterServer `BusinessTimeUtils.getBusinessTime(CommandType commandType, Date runTime)`
<img width="888" alt="image" src="https://user-images.githubusercontent.com/48642743/154096291-72dd0cf4-62e2-456c-98d5-a47750b3b420.png">
### Version
2.0.3
### 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/8394 | https://github.com/apache/dolphinscheduler/pull/8532 | ca6d148a1b48195a359a3ab29d449229a87dd05a | e174d7a40ef8326d698701e97fe347fd730f1277 | 2022-02-15T15:42:21Z | java | 2022-02-25T02:27:08Z | dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/task/paramparser/BusinessTimeUtils.java | Date businessDate = runTime;
switch (commandType) {
case COMPLEMENT_DATA:
break;
case START_PROCESS:
case START_CURRENT_TASK_PROCESS:
case RECOVER_TOLERANCE_FAULT_PROCESS:
case RECOVER_SUSPENDED_PROCESS:
case START_FAILURE_TASK_PROCESS:
case REPEAT_RUNNING:
case SCHEDULER:
default:
businessDate = addDays(new Date(), -1);
if (runTime != null) {
/**
* If there is a scheduled time, take the scheduling time. Recovery from failed nodes, suspension of recovery, re-run for scheduling
*/
businessDate = addDays(runTime, -1);
}
break;
}
Date businessCurrentDate = addDays(businessDate, 1);
Map<String, String> result = new HashMap<>();
result.put(PARAMETER_CURRENT_DATE, format(businessCurrentDate, PARAMETER_FORMAT_DATE));
result.put(PARAMETER_BUSINESS_DATE, format(businessDate, PARAMETER_FORMAT_DATE));
result.put(PARAMETER_DATETIME, format(businessCurrentDate, PARAMETER_FORMAT_TIME));
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/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 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * 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
* 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; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | mport org.apache.dolphnscheduler.common.enums.TaskDependType;
mport org.apache.dolphnscheduler.common.enums.TaskGroupQueueStatus;
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.utls.DateUtls;
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.ProcessTaskRelaton;
mport org.apache.dolphnscheduler.dao.entty.ProjectUser;
mport org.apache.dolphnscheduler.dao.entty.Schedule;
mport org.apache.dolphnscheduler.dao.entty.TaskDefntonLog;
mport org.apache.dolphnscheduler.dao.entty.TaskGroupQueue;
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; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | 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.collectons.CollectonUtls;
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;
mport java.utl.Lst;
mport java.utl.Map;
mport java.utl.Map.Entry;
mport java.utl.Objects;
mport java.utl.Set;
mport java.utl.concurrent.ConcurrentHashMap;
mport java.utl.concurrent.ConcurrentLnkedQueue;
mport java.utl.concurrent.atomc.AtomcBoolean;
mport org.slf4j.Logger;
mport org.slf4j.LoggerFactory;
mport com.google.common.collect.Lsts;
/**
* master exec thread,splt dag
*/
publc class WorkflowExecuteThread {
/**
* logger of WorkflowExecuteThread |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | */
prvate statc fnal Logger logger = LoggerFactory.getLogger(WorkflowExecuteThread.class);
/**
* master confg
*/
prvate MasterConfg masterConfg;
/**
* process servce
*/
prvate ProcessServce processServce;
/**
* alert manager
*/
prvate ProcessAlertManager processAlertManager;
/**
* netty executor manager
*/
prvate NettyExecutorManager nettyExecutorManager;
/**
* process nstance
*/
prvate ProcessInstance processInstance;
/**
* process defnton
*/
prvate ProcessDefnton processDefnton;
/**
* the object of DAG
*/
prvate DAG<Strng, TaskNode, TaskNodeRelaton> dag; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | /**
* key of workflow
*/
prvate Strng key;
/**
* start flag, true: start nodes submt completely
*/
prvate boolean sStart = false;
/**
* submt falure nodes
*/
prvate boolean taskFaledSubmt = false;
/**
* task nstance hash map, taskId as key
*/
prvate Map<Integer, TaskInstance> taskInstanceMap = new ConcurrentHashMap<>();
/**
* runnng taskProcessor, taskCode as key, taskProcessor as value
* only on taskProcessor per taskCode
*/
prvate fnal Map<Long, ITaskProcessor> actveTaskProcessorMaps = new ConcurrentHashMap<>();
/**
* vald task map, taskCode as key, taskId as value
* n a DAG, only one taskInstance per taskCode s vald
*/
prvate Map<Long, Integer> valdTaskMap = new ConcurrentHashMap<>();
/**
* error task map, taskCode as key, taskInstanceId as value
* n a DAG, only one taskInstance per taskCode s vald
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate Map<Long, Integer> errorTaskMap = new ConcurrentHashMap<>();
/**
* complete task map, taskCode as key, taskInstanceId as value
* n a DAG, only one taskInstance per taskCode s vald
*/
prvate Map<Long, Integer> completeTaskMap = new ConcurrentHashMap<>();
/**
* depend faled task map, taskCode as key, taskId as value
*/
prvate Map<Long, Integer> dependFaledTaskMap = new ConcurrentHashMap<>();
/**
* forbdden task map, code as key
*/
prvate Map<Long, TaskNode> forbddenTaskMap = new ConcurrentHashMap<>();
/**
* skp task map, code as key
*/
prvate Map<Strng, TaskNode> skpTaskNodeMap = new ConcurrentHashMap<>();
/**
* complement date lst
*/
prvate Lst<Date> complementLstDate = Lsts.newLnkedLst();
/**
* state event queue
*/
prvate ConcurrentLnkedQueue<StateEvent> stateEvents = new ConcurrentLnkedQueue<>();
/**
* ready to submt task queue
*/
prvate PeerTaskInstancePrortyQueue readyToSubmtTaskQueue = new PeerTaskInstancePrortyQueue(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | /**
* wat to retry taskInstance map, taskCode as key, taskInstance as value
* before retry, the taskInstance d s 0
*/
prvate Map<Long, TaskInstance> watToRetryTaskInstanceMap = new ConcurrentHashMap<>();
/**
* state wheel execute thread
*/
prvate StateWheelExecuteThread stateWheelExecuteThread;
/**
* constructor of WorkflowExecuteThread
*
* @param processInstance processInstance
* @param processServce processServce
* @param nettyExecutorManager nettyExecutorManager
* @param processAlertManager processAlertManager
* @param masterConfg masterConfg
* @param stateWheelExecuteThread stateWheelExecuteThread
*/
publc WorkflowExecuteThread(ProcessInstance processInstance
, ProcessServce processServce
, NettyExecutorManager nettyExecutorManager
, ProcessAlertManager processAlertManager
, MasterConfg masterConfg
, StateWheelExecuteThread stateWheelExecuteThread) {
ths.processServce = processServce;
ths.processInstance = processInstance;
ths.masterConfg = masterConfg;
ths.nettyExecutorManager = nettyExecutorManager;
ths.processAlertManager = processAlertManager; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | ths.stateWheelExecuteThread = stateWheelExecuteThread;
}
/**
* the process start nodes are submtted completely.
*/
publc boolean sStart() {
return ths.sStart;
}
/**
* handle event
*/
publc vod handleEvents() {
f (!sStart) {
return;
}
whle (!ths.stateEvents.sEmpty()) {
try {
StateEvent stateEvent = ths.stateEvents.peek();
f (stateEventHandler(stateEvent)) {
ths.stateEvents.remove(stateEvent);
}
} catch (Excepton e) {
logger.error("state handle error:", e);
}
}
}
publc Strng getKey() {
f (StrngUtls.sNotEmpty(key)
|| ths.processDefnton == null) {
return key; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
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 (!checkProcessInstance(stateEvent)) {
return false;
}
boolean result = false;
swtch (stateEvent.getType()) {
case PROCESS_STATE_CHANGE:
result = processStateChangeHandler(stateEvent); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | break;
case TASK_STATE_CHANGE:
result = taskStateChangeHandler(stateEvent);
break;
case PROCESS_TIMEOUT:
result = processTmeout();
break;
case TASK_TIMEOUT:
result = taskTmeout(stateEvent);
break;
case WAIT_TASK_GROUP:
result = checkForceStartAndWakeUp(stateEvent);
break;
case TASK_RETRY:
result = taskRetryEventHandler(stateEvent);
break;
default:
break;
}
f (result) {
ths.stateEvents.remove(stateEvent);
}
return result;
}
prvate boolean checkForceStartAndWakeUp(StateEvent stateEvent) {
TaskGroupQueue taskGroupQueue = ths.processServce.loadTaskGroupQueue(stateEvent.getTaskInstanceId());
f (taskGroupQueue.getForceStart() == Flag.YES.getCode()) {
TaskInstance taskInstance = ths.processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId());
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskInstance.getTaskCode());
ProcessInstance processInstance = ths.processServce.fndProcessInstanceById(taskInstance.getProcessInstanceId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskProcessor.nt(taskInstance, processInstance);
taskProcessor.acton(TaskActon.DISPATCH);
ths.processServce.updateTaskGroupQueueStatus(taskGroupQueue.getId(), TaskGroupQueueStatus.ACQUIRE_SUCCESS.getCode());
return true;
}
f (taskGroupQueue.getInQueue() == Flag.YES.getCode()) {
boolean acqureTaskGroup = processServce.acqureTaskGroupAgan(taskGroupQueue);
f (acqureTaskGroup) {
TaskInstance taskInstance = ths.processServce.fndTaskInstanceById(stateEvent.getTaskInstanceId());
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskInstance.getTaskCode());
ProcessInstance processInstance = ths.processServce.fndProcessInstanceById(taskInstance.getProcessInstanceId());
taskProcessor.nt(taskInstance, processInstance);
taskProcessor.acton(TaskActon.DISPATCH);
return true;
}
}
return false;
}
prvate boolean taskTmeout(StateEvent stateEvent) {
f (!checkTaskInstanceByStateEvent(stateEvent)) {
return true;
}
TaskInstance taskInstance = taskInstanceMap.get(stateEvent.getTaskInstanceId());
f (TmeoutFlag.CLOSE == taskInstance.getTaskDefne().getTmeoutFlag()) {
return true;
}
TaskTmeoutStrategy taskTmeoutStrategy = taskInstance.getTaskDefne().getTmeoutNotfyStrategy();
f (TaskTmeoutStrategy.FAILED == taskTmeoutStrategy) {
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskInstance.getTaskCode());
taskProcessor.acton(TaskActon.TIMEOUT); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | } 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) {
f (!checkTaskInstanceByStateEvent(stateEvent)) {
return true;
}
TaskInstance task = getTaskInstance(stateEvent.getTaskInstanceId());
f (task.getState() == null) {
logger.error("task state s null, state handler error: {}", stateEvent);
return true;
}
f (task.getState().typeIsFnshed()) {
f (completeTaskMap.contansKey(task.getTaskCode()) && completeTaskMap.get(task.getTaskCode()) == task.getId()) {
return true;
}
taskFnshed(task);
f (task.getTaskGroupId() > 0) {
releaseTaskGroup(task);
}
return true;
}
f (actveTaskProcessorMaps.contansKey(task.getTaskCode())) {
ITaskProcessor TaskProcessor = actveTaskProcessorMaps.get(task.getTaskCode()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | TaskProcessor.acton(TaskActon.RUN);
f (TaskProcessor.taskInstance().getState().typeIsFnshed()) {
taskFnshed(task);
}
return true;
}
logger.error("state handler error: {}", stateEvent);
return true;
}
prvate vod taskFnshed(TaskInstance taskInstance) {
logger.nfo("work flow {} task d:{} code:{} state:{} ",
processInstance.getId(),
taskInstance.getId(),
taskInstance.getTaskCode(),
taskInstance.getState());
actveTaskProcessorMaps.remove(taskInstance.getTaskCode());
stateWheelExecuteThread.removeTask4TmeoutCheck(processInstance, taskInstance);
stateWheelExecuteThread.removeTask4RetryCheck(processInstance, taskInstance);
stateWheelExecuteThread.removeTask4StateCheck(processInstance, taskInstance);
f (taskInstance.getState().typeIsSuccess()) {
completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());
processInstance.setVarPool(taskInstance.getVarPool());
processServce.saveProcessInstance(processInstance);
submtPostNode(Long.toStrng(taskInstance.getTaskCode()));
} else f (taskInstance.taskCanRetry() && processInstance.getState() != ExecutonStatus.READY_STOP) {
retryTaskInstance(taskInstance);
} else f (taskInstance.getState().typeIsFalure()) {
completeTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());
f (taskInstance.sCondtonsTask() |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | || DagHelper.haveCondtonsAfterNode(Long.toStrng(taskInstance.getTaskCode()), dag)) {
submtPostNode(Long.toStrng(taskInstance.getTaskCode()));
} else {
errorTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());
f (processInstance.getFalureStrategy() == FalureStrategy.END) {
kllAllTasks();
}
}
}
ths.updateProcessInstanceState();
}
/**
* release task group
* @param taskInstance
*/
prvate vod releaseTaskGroup(TaskInstance taskInstance) {
f (taskInstance.getTaskGroupId() > 0) {
TaskInstance nextTaskInstance = ths.processServce.releaseTaskGroup(taskInstance);
f (nextTaskInstance != null) {
f (nextTaskInstance.getProcessInstanceId() == taskInstance.getProcessInstanceId()) {
StateEvent nextEvent = new StateEvent();
nextEvent.setProcessInstanceId(ths.processInstance.getId());
nextEvent.setTaskInstanceId(nextTaskInstance.getId());
nextEvent.setType(StateEventType.WAIT_TASK_GROUP);
ths.stateEvents.add(nextEvent);
} else {
ProcessInstance processInstance = ths.processServce.fndProcessInstanceById(nextTaskInstance.getProcessInstanceId());
ths.processServce.sendStartTask2Master(processInstance, nextTaskInstance.getId(),
org.apache.dolphnscheduler.remote.command.CommandType.TASK_WAKEUP_EVENT_REQUEST);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
}
}
/**
* crate new task nstance to retry, dfferent objects from the orgnal
* @param taskInstance
*/
prvate vod retryTaskInstance(TaskInstance taskInstance) {
f (!taskInstance.taskCanRetry()) {
return;
}
TaskInstance newTaskInstance = cloneRetryTaskInstance(taskInstance);
f (newTaskInstance == null) {
logger.error("retry fal, new taskInstancce s null, task code:{}, task d:{}", taskInstance.getTaskCode(), taskInstance.getId());
return;
}
watToRetryTaskInstanceMap.put(newTaskInstance.getTaskCode(), newTaskInstance);
f (!taskInstance.retryTaskIntervalOverTme()) {
logger.nfo("falure task wll be submtted: process d: {}, task nstance code: {} state:{} retry tmes:{} / {}, nterval:{}",
processInstance.getId(),
newTaskInstance.getTaskCode(),
newTaskInstance.getState(),
newTaskInstance.getRetryTmes(),
newTaskInstance.getMaxRetryTmes(),
newTaskInstance.getRetryInterval());
stateWheelExecuteThread.addTask4TmeoutCheck(processInstance, newTaskInstance);
stateWheelExecuteThread.addTask4RetryCheck(processInstance, newTaskInstance);
} else {
addTaskToStandByLst(newTaskInstance);
submtStandByTask(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | watToRetryTaskInstanceMap.remove(newTaskInstance.getTaskCode());
}
}
/**
* handle task retry event
* @param stateEvent
* @return
*/
prvate boolean taskRetryEventHandler(StateEvent stateEvent) {
TaskInstance taskInstance = watToRetryTaskInstanceMap.get(stateEvent.getTaskCode());
addTaskToStandByLst(taskInstance);
submtStandByTask();
watToRetryTaskInstanceMap.remove(stateEvent.getTaskCode());
return true;
}
/**
* update process nstance
*/
publc vod refreshProcessInstance(nt processInstanceId) {
logger.nfo("process nstance update: {}", processInstanceId);
processInstance = processServce.fndProcessInstanceById(processInstanceId);
processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(),
processInstance.getProcessDefntonVerson());
processInstance.setProcessDefnton(processDefnton);
}
/**
* update task nstance
*/
publc vod refreshTaskInstance(nt taskInstanceId) {
logger.nfo("task nstance update: {} ", taskInstanceId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | TaskInstance taskInstance = processServce.fndTaskInstanceById(taskInstanceId);
f (taskInstance == null) {
logger.error("can not fnd task nstance, d:{}", taskInstanceId);
return;
}
processServce.packageTaskInstance(taskInstance, processInstance);
taskInstanceMap.put(taskInstance.getId(), taskInstance);
valdTaskMap.remove(taskInstance.getTaskCode());
f (Flag.YES == taskInstance.getFlag()) {
valdTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());
}
}
/**
* check process nstance by state event
*/
publc boolean checkProcessInstance(StateEvent stateEvent) {
f (ths.processInstance.getId() != stateEvent.getProcessInstanceId()) {
logger.error("msmatch process nstance d: {}, state event:{}",
ths.processInstance.getId(),
stateEvent);
return false;
}
return true;
}
/**
* check f task nstance exst by state event
*/
publc boolean checkTaskInstanceByStateEvent(StateEvent stateEvent) {
f (stateEvent.getTaskInstanceId() == 0) {
logger.error("task nstance d null, state event:{}", stateEvent); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | return false;
}
f (!taskInstanceMap.contansKey(stateEvent.getTaskInstanceId())) {
logger.error("msmatch task nstance d, event:{}", stateEvent);
return false;
}
return true;
}
/**
* check f task nstance exst by task code
*/
publc boolean checkTaskInstanceByCode(long taskCode) {
f (taskInstanceMap == null || taskInstanceMap.sze() == 0) {
return false;
}
for (TaskInstance taskInstance : taskInstanceMap.values()) {
f (taskInstance.getTaskCode() == taskCode) {
return true;
}
}
return false;
}
/**
* check f task nstance exst by d
*/
publc boolean checkTaskInstanceById(nt taskInstanceId) {
f (taskInstanceMap == null || taskInstanceMap.sze() == 0) {
return false;
}
return taskInstanceMap.contansKey(taskInstanceId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* get task nstance from memory
*/
publc TaskInstance getTaskInstance(nt taskInstanceId) {
f (taskInstanceMap.contansKey(taskInstanceId)) {
return taskInstanceMap.get(taskInstanceId);
}
return null;
}
publc TaskInstance getActveTaskInstanceByTaskCode(long taskCode) {
f (actveTaskProcessorMaps.contansKey(taskCode)) {
return actveTaskProcessorMaps.get(taskCode).taskInstance();
}
return null;
}
publc TaskInstance getRetryTaskInstanceByTaskCode(long taskCode) {
f (watToRetryTaskInstanceMap.contansKey(taskCode)) {
return watToRetryTaskInstanceMap.get(taskCode);
}
return null;
}
prvate boolean processStateChangeHandler(StateEvent stateEvent) {
try {
logger.nfo("process:{} state {} change to {}", processInstance.getId(), processInstance.getState(), stateEvent.getExecutonStatus());
f (stateEvent.getExecutonStatus() == ExecutonStatus.STOP) {
ths.updateProcessInstanceState(stateEvent);
return true;
}
f (processComplementData()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/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;
}
f (processInstance.getState() == ExecutonStatus.READY_STOP) {
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;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | nt ndex = complementLstDate.ndexOf(scheduleDate);
f (ndex >= complementLstDate.sze() - 1 || !processInstance.getState().typeIsSuccess()) {
logger.nfo("process complement end. process d:{}", processInstance.getId());
return true;
}
logger.nfo("process complement contnue. process d:{}, schedule tme:{} complementLstDate:{}",
processInstance.getId(),
processInstance.getScheduleTme(),
complementLstDate.toStrng());
scheduleDate = complementLstDate.get(ndex + 1);
}
nt create = ths.createComplementDataCommand(scheduleDate);
f (create > 0) {
logger.nfo("create complement data command successfully.");
}
return true;
}
prvate nt createComplementDataCommand(Date scheduleDate) {
Command command = new Command();
command.setScheduleTme(scheduleDate);
command.setCommandType(CommandType.COMPLEMENT_DATA);
command.setProcessDefntonCode(processInstance.getProcessDefntonCode());
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);
}
cmdParam.replace(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtls.format(scheduleDate, "yyyy-MM-dd HH:mm:ss", null));
command.setCommandParam(JSONUtls.toJsonStrng(cmdParam)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | command.setTaskDependType(processInstance.getTaskDependType());
command.setFalureStrategy(processInstance.getFalureStrategy());
command.setWarnngType(processInstance.getWarnngType());
command.setWarnngGroupId(processInstance.getWarnngGroupId());
command.setStartTme(new Date());
command.setExecutorId(processInstance.getExecutorId());
command.setUpdateTme(new Date());
command.setProcessInstanceProrty(processInstance.getProcessInstanceProrty());
command.setWorkerGroup(processInstance.getWorkerGroup());
command.setEnvronmentCode(processInstance.getEnvronmentCode());
command.setDryRun(processInstance.getDryRun());
command.setProcessInstanceId(0);
command.setProcessDefntonVerson(processInstance.getProcessDefntonVerson());
return processServce.createCommand(command);
}
prvate boolean needComplementProcess() {
f (processInstance.sComplementData()
&& Flag.NO == processInstance.getIsSubProcess()) {
return true;
}
return false;
}
/**
* process start handle
*/
publc vod startProcess() {
f (ths.taskInstanceMap.sze() > 0) {
return;
}
try { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | sStart = false;
buldFlowDag();
ntTaskQueue();
submtPostNode(null);
sStart = true;
} catch (Excepton e) {
logger.error("start process error, process nstance d:{}", processInstance.getId(), e);
}
}
/**
* process end handle
*/
prvate vod endProcess() {
ths.stateEvents.clear();
f (processDefnton.getExecutonType().typeIsSeralWat()) {
checkSeralProcess(processDefnton);
}
f (processInstance.getState().typeIsWatngThread()) {
processServce.createRecoveryWatngThreadCommand(null, processInstance);
}
f (processAlertManager.sNeedToSendWarnng(processInstance)) {
ProjectUser projectUser = processServce.queryProjectWthUserByProcessInstanceId(processInstance.getId());
processAlertManager.sendAlertProcessInstance(processInstance, getValdTaskLst(), projectUser);
}
f (checkTaskQueue()) {
processServce.releaseAllTaskGroup(processInstance.getId());
}
}
publc vod checkSeralProcess(ProcessDefnton processDefnton) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | 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
*/
prvate vod buldFlowDag() throws Excepton {
f (ths.dag != null) {
return;
}
processDefnton = processServce.fndProcessDefnton(processInstance.getProcessDefntonCode(), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | processInstance.getProcessDefntonVerson());
processInstance.setProcessDefnton(processDefnton);
Lst<TaskInstance> recoverNodeLst = getStartTaskInstanceLst(processInstance.getCommandParam());
Lst<ProcessTaskRelaton> processTaskRelatons = processServce.fndRelatonByCode(processDefnton.getCode(), processDefnton.getVerson());
Lst<TaskDefntonLog> taskDefntonLogs = processServce.getTaskDefneLogLstByRelaton(processTaskRelatons);
Lst<TaskNode> taskNodeLst = processServce.transformTask(processTaskRelatons, taskDefntonLogs);
forbddenTaskMap.clear();
taskNodeLst.forEach(taskNode -> {
f (taskNode.sForbdden()) {
forbddenTaskMap.put(taskNode.getCode(), taskNode);
}
});
Lst<Strng> recoveryNodeCodeLst = getRecoveryNodeCodeLst(recoverNodeLst);
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
*/
prvate vod ntTaskQueue() {
taskFaledSubmt = false;
actveTaskProcessorMaps.clear(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | dependFaledTaskMap.clear();
completeTaskMap.clear();
errorTaskMap.clear();
f (!sNewProcessInstance()) {
Lst<TaskInstance> valdTaskInstanceLst = processServce.fndValdTaskLstByProcessId(processInstance.getId());
for (TaskInstance task : valdTaskInstanceLst) {
f (valdTaskMap.contansKey(task.getTaskCode())) {
nt oldTaskInstanceId = valdTaskMap.get(task.getTaskCode());
TaskInstance oldTaskInstance = taskInstanceMap.get(oldTaskInstanceId);
f (!oldTaskInstance.getState().typeIsFnshed() && task.getState().typeIsFnshed()) {
task.setFlag(Flag.NO);
processServce.updateTaskInstance(task);
contnue;
}
logger.warn("have same taskCode taskInstance when nt task queue, taskCode:{}", task.getTaskCode());
}
valdTaskMap.put(task.getTaskCode(), task.getId());
taskInstanceMap.put(task.getId(), task);
f (task.sTaskComplete()) {
completeTaskMap.put(task.getTaskCode(), task.getId());
contnue;
}
f (task.sCondtonsTask() || DagHelper.haveCondtonsAfterNode(Long.toStrng(task.getTaskCode()), dag)) {
contnue;
}
f (task.taskCanRetry()) {
f (task.getState() == ExecutonStatus.NEED_FAULT_TOLERANCE) {
TaskInstance tolerantTaskInstance = cloneTolerantTaskInstance(task);
addTaskToStandByLst(tolerantTaskInstance); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | } else {
retryTaskInstance(task);
}
contnue;
}
f (task.getState().typeIsFalure()) {
errorTaskMap.put(task.getTaskCode(), task.getId());
}
}
}
f (processInstance.sComplementData() && complementLstDate.sze() == 0) {
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
f (cmdParam != null && cmdParam.contansKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) {
Date start = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE));
Date end = DateUtls.strngToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE));
Lst<Schedule> schedules = processServce.queryReleaseSchedulerLstByProcessDefntonCode(processInstance.getProcessDefntonCode());
f (complementLstDate.sze() == 0 && needComplementProcess()) {
complementLstDate = CronUtls.getSelfFreDateLst(start, end, schedules);
logger.nfo(" process defnton code:{} complement data: {}",
processInstance.getProcessDefntonCode(), complementLstDate.toStrng());
f (complementLstDate.sze() > 0 && Flag.NO == processInstance.getIsSubProcess()) {
processInstance.setScheduleTme(complementLstDate.get(0));
processInstance.setGlobalParams(ParameterUtls.curngGlobalParams(
processDefnton.getGlobalParamMap(),
processDefnton.getGlobalParamLst(),
CommandType.COMPLEMENT_DATA, processInstance.getScheduleTme()));
processServce.updateProcessInstance(processInstance);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
}
/**
* submt task to execute
*
* @param taskInstance task nstance
* @return TaskInstance
*/
prvate TaskInstance submtTaskExec(TaskInstance taskInstance) {
try {
processServce.packageTaskInstance(taskInstance, processInstance);
ITaskProcessor taskProcessor = TaskProcessorFactory.getTaskProcessor(taskInstance.getTaskType());
taskProcessor.nt(taskInstance, processInstance);
f (taskInstance.getState() == ExecutonStatus.RUNNING_EXECUTION
&& taskProcessor.getType().equalsIgnoreCase(Constants.COMMON_TASK_TYPE)) {
notfyProcessHostUpdate(taskInstance);
}
boolean submt = taskProcessor.acton(TaskActon.SUBMIT);
f (!submt) {
logger.error("process d:{} name:{} submt standby task d:{} name:{} faled!",
processInstance.getId(), processInstance.getName(),
taskInstance.getId(), taskInstance.getName());
return null;
}
f (valdTaskMap.contansKey(taskInstance.getTaskCode())) {
nt oldTaskInstanceId = valdTaskMap.get(taskInstance.getTaskCode());
f (taskInstance.getId() != oldTaskInstanceId) {
TaskInstance oldTaskInstance = taskInstanceMap.get(oldTaskInstanceId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | oldTaskInstance.setFlag(Flag.NO);
processServce.updateTaskInstance(oldTaskInstance);
valdTaskMap.remove(taskInstance.getTaskCode());
actveTaskProcessorMaps.remove(taskInstance.getTaskCode());
}
}
valdTaskMap.put(taskInstance.getTaskCode(), taskInstance.getId());
taskInstanceMap.put(taskInstance.getId(), taskInstance);
actveTaskProcessorMaps.put(taskInstance.getTaskCode(), taskProcessor);
taskProcessor.acton(TaskActon.RUN);
stateWheelExecuteThread.addTask4TmeoutCheck(processInstance, taskInstance);
stateWheelExecuteThread.addTask4StateCheck(processInstance, taskInstance);
f (taskProcessor.taskInstance().getState().typeIsFnshed()) {
StateEvent stateEvent = new StateEvent();
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setExecutonStatus(taskProcessor.taskInstance().getState());
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
ths.stateEvents.add(stateEvent);
}
return taskInstance;
} catch (Excepton e) {
logger.error("submt standby task error", e);
return null;
}
}
prvate vod notfyProcessHostUpdate(TaskInstance taskInstance) {
f (StrngUtls.sEmpty(taskInstance.getHost())) {
return;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | try {
HostUpdateCommand hostUpdateCommand = new HostUpdateCommand();
hostUpdateCommand.setProcessHost(NetUtls.getAddr(masterConfg.getLstenPort()));
hostUpdateCommand.setTaskInstanceId(taskInstance.getId());
Host host = new Host(taskInstance.getHost());
nettyExecutorManager.doExecute(host, hostUpdateCommand.convert2Command());
} catch (Excepton e) {
logger.error("notfy process host update", e);
}
}
/**
* fnd task nstance n db.
* n case submt more than one same name task n the same tme.
*
* @param taskCode task code
* @param taskVerson task verson
* @return TaskInstance
*/
prvate TaskInstance fndTaskIfExsts(Long taskCode, nt taskVerson) {
Lst<TaskInstance> valdTaskInstanceLst = getValdTaskLst();
for (TaskInstance taskInstance : valdTaskInstanceLst) {
f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == taskVerson) {
return taskInstance;
}
}
return null;
}
/**
* encapsulaton task
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @param processInstance process nstance
* @param taskNode taskNode
* @return TaskInstance
*/
prvate TaskInstance createTaskInstance(ProcessInstance processInstance, TaskNode taskNode) {
TaskInstance taskInstance = fndTaskIfExsts(taskNode.getCode(), taskNode.getVerson());
f (taskInstance != null) {
return taskInstance;
}
return newTaskInstance(processInstance, taskNode);
}
/**
* clone a new taskInstance for retry and reset some logc felds
* @return
*/
publc TaskInstance cloneRetryTaskInstance(TaskInstance taskInstance) {
TaskNode taskNode = dag.getNode(Long.toStrng(taskInstance.getTaskCode()));
f (taskNode == null) {
logger.error("taskNode s null, code:{}", taskInstance.getTaskCode());
return null;
}
TaskInstance newTaskInstance = newTaskInstance(processInstance, taskNode);
newTaskInstance.setTaskDefne(taskInstance.getTaskDefne());
newTaskInstance.setProcessDefne(taskInstance.getProcessDefne());
newTaskInstance.setProcessInstance(processInstance);
newTaskInstance.setRetryTmes(taskInstance.getRetryTmes() + 1);
newTaskInstance.setState(taskInstance.getState());
newTaskInstance.setEndTme(taskInstance.getEndTme());
return newTaskInstance; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* clone a new taskInstance for tolerant and reset some logc felds
* @return
*/
publc TaskInstance cloneTolerantTaskInstance(TaskInstance taskInstance) {
TaskNode taskNode = dag.getNode(Long.toStrng(taskInstance.getTaskCode()));
f (taskNode == null) {
logger.error("taskNode s null, code:{}", taskInstance.getTaskCode());
return null;
}
TaskInstance newTaskInstance = newTaskInstance(processInstance, taskNode);
newTaskInstance.setTaskDefne(taskInstance.getTaskDefne());
newTaskInstance.setProcessDefne(taskInstance.getProcessDefne());
newTaskInstance.setProcessInstance(processInstance);
newTaskInstance.setRetryTmes(taskInstance.getRetryTmes());
newTaskInstance.setState(taskInstance.getState());
return newTaskInstance;
}
/**
* new a taskInstance
* @param processInstance
* @param taskNode
* @return
*/
publc TaskInstance newTaskInstance(ProcessInstance processInstance, TaskNode taskNode) {
TaskInstance taskInstance = new TaskInstance();
taskInstance.setTaskCode(taskNode.getCode());
taskInstance.setTaskDefntonVerson(taskNode.getVerson()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setName(taskNode.getName());
taskInstance.setState(ExecutonStatus.SUBMITTED_SUCCESS);
taskInstance.setProcessInstanceId(processInstance.getId());
taskInstance.setTaskType(taskNode.getType().toUpperCase());
taskInstance.setAlertFlag(Flag.NO);
taskInstance.setStartTme(null);
taskInstance.setFlag(Flag.YES);
taskInstance.setDryRun(processInstance.getDryRun());
taskInstance.setRetryTmes(0);
taskInstance.setMaxRetryTmes(taskNode.getMaxRetryTmes());
taskInstance.setRetryInterval(taskNode.getRetryInterval());
taskInstance.setTaskParams(taskNode.getTaskParams());
taskInstance.setTaskGroupId(taskNode.getTaskGroupId());
taskInstance.setTaskGroupProrty(taskNode.getTaskGroupProrty());
f (taskNode.getTaskInstanceProrty() == null) {
taskInstance.setTaskInstanceProrty(Prorty.MEDIUM);
} else { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | taskInstance.setTaskInstanceProrty(taskNode.getTaskInstanceProrty());
}
Strng processWorkerGroup = processInstance.getWorkerGroup();
processWorkerGroup = StrngUtls.sBlank(processWorkerGroup) ? DEFAULT_WORKER_GROUP : processWorkerGroup;
Strng taskWorkerGroup = StrngUtls.sBlank(taskNode.getWorkerGroup()) ? processWorkerGroup : taskNode.getWorkerGroup();
Long processEnvronmentCode = Objects.sNull(processInstance.getEnvronmentCode()) ? -1 : processInstance.getEnvronmentCode();
Long taskEnvronmentCode = Objects.sNull(taskNode.getEnvronmentCode()) ? processEnvronmentCode : taskNode.getEnvronmentCode();
f (!processWorkerGroup.equals(DEFAULT_WORKER_GROUP) && taskWorkerGroup.equals(DEFAULT_WORKER_GROUP)) {
taskInstance.setWorkerGroup(processWorkerGroup);
taskInstance.setEnvronmentCode(processEnvronmentCode);
} else {
taskInstance.setWorkerGroup(taskWorkerGroup);
taskInstance.setEnvronmentCode(taskEnvronmentCode);
}
f (!taskInstance.getEnvronmentCode().equals(-1L)) {
Envronment envronment = processServce.fndEnvronmentByCode(taskInstance.getEnvronmentCode());
f (Objects.nonNull(envronment) && StrngUtls.sNotEmpty(envronment.getConfg())) {
taskInstance.setEnvronmentConfg(envronment.getConfg());
}
}
taskInstance.setDelayTme(taskNode.getDelayTme());
return taskInstance;
}
publc vod getPreVarPool(TaskInstance taskInstance, Set<Strng> preTask) {
Map<Strng, Property> allProperty = new HashMap<>();
Map<Strng, TaskInstance> allTaskInstance = new HashMap<>();
f (CollectonUtls.sNotEmpty(preTask)) {
for (Strng preTaskCode : preTask) {
Integer taskId = completeTaskMap.get(Long.parseLong(preTaskCode)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (taskId == null) {
contnue;
}
TaskInstance preTaskInstance = taskInstanceMap.get(taskId);
f (preTaskInstance == null) {
contnue;
}
Strng preVarPool = preTaskInstance.getVarPool();
f (StrngUtls.sNotEmpty(preVarPool)) {
Lst<Property> propertes = JSONUtls.toLst(preVarPool, Property.class);
for (Property nfo : propertes) {
setVarPoolValue(allProperty, allTaskInstance, preTaskInstance, nfo);
}
}
}
f (allProperty.sze() > 0) {
taskInstance.setVarPool(JSONUtls.toJsonStrng(allProperty.values()));
}
}
}
prvate vod setVarPoolValue(Map<Strng, Property> allProperty, Map<Strng, TaskInstance> allTaskInstance, TaskInstance preTaskInstance, Property thsProperty) {
thsProperty.setDrect(Drect.IN);
Strng proName = thsProperty.getProp();
f (allProperty.contansKey(proName)) {
Property otherPro = allProperty.get(proName); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (StrngUtls.sEmpty(thsProperty.getValue())) {
allProperty.put(proName, otherPro);
} else f (StrngUtls.sNotEmpty(otherPro.getValue())) {
TaskInstance otherTask = allTaskInstance.get(proName);
f (otherTask.getEndTme().getTme() > preTaskInstance.getEndTme().getTme()) {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
} else {
allProperty.put(proName, otherPro);
}
} else {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
}
} else {
allProperty.put(proName, thsProperty);
allTaskInstance.put(proName, preTaskInstance);
}
}
/**
* get complete task nstance map, taskCode as key
*/
prvate Map<Strng, TaskInstance> getCompleteTaskInstanceMap() {
Map<Strng, TaskInstance> completeTaskInstanceMap = new HashMap<>();
for (Integer taskInstanceId : completeTaskMap.values()) {
TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId);
completeTaskInstanceMap.put(Long.toStrng(taskInstance.getTaskCode()), taskInstance);
}
return completeTaskInstanceMap; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* get vald task lst
*/
prvate Lst<TaskInstance> getValdTaskLst() {
Lst<TaskInstance> valdTaskInstanceLst = new ArrayLst<>();
for (Integer taskInstanceId : valdTaskMap.values()) {
valdTaskInstanceLst.add(taskInstanceMap.get(taskInstanceId));
}
return valdTaskInstanceLst;
}
prvate vod submtPostNode(Strng parentNodeCode) {
Set<Strng> submtTaskNodeLst = DagHelper.parsePostNodes(parentNodeCode, skpTaskNodeMap, dag, getCompleteTaskInstanceMap());
Lst<TaskInstance> taskInstances = new ArrayLst<>();
for (Strng taskNode : submtTaskNodeLst) {
TaskNode taskNodeObject = dag.getNode(taskNode);
f (checkTaskInstanceByCode(taskNodeObject.getCode())) {
contnue;
}
TaskInstance task = createTaskInstance(processInstance, taskNodeObject);
taskInstances.add(task);
}
for (TaskInstance task : taskInstances) {
f (readyToSubmtTaskQueue.contans(task)) {
contnue;
}
f (task.getId() > 0 && completeTaskMap.contansKey(task.getTaskCode())) {
logger.nfo("task {} has already run success", task.getName());
contnue; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
f (task.getState().typeIsPause() || task.getState().typeIsCancel()) {
logger.nfo("task {} stopped, the state s {}", task.getName(), task.getState());
contnue;
}
addTaskToStandByLst(task);
}
submtStandByTask();
updateProcessInstanceState();
}
/**
* determne whether the dependences of the task node are complete
*
* @return DependResult
*/
prvate DependResult sTaskDepsComplete(Strng taskCode) {
Collecton<Strng> startNodes = dag.getBegnNode();
f (startNodes.contans(taskCode)) {
return DependResult.SUCCESS;
}
TaskNode taskNode = dag.getNode(taskCode);
Lst<Strng> ndrectDepCodeLst = new ArrayLst<>();
setIndrectDepLst(taskCode, ndrectDepCodeLst);
for (Strng depsNode : ndrectDepCodeLst) {
f (dag.contansNode(depsNode) && !skpTaskNodeMap.contansKey(depsNode)) {
Long despNodeTaskCode = Long.parseLong(depsNode);
f (!completeTaskMap.contansKey(despNodeTaskCode)) {
return DependResult.WAITING; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
Integer depsTaskId = completeTaskMap.get(despNodeTaskCode);
ExecutonStatus depTaskState = taskInstanceMap.get(depsTaskId).getState();
f (depTaskState.typeIsPause() || depTaskState.typeIsCancel()) {
return DependResult.NON_EXEC;
}
f (taskNode.sCondtonsTask()) {
contnue;
}
f (!dependTaskSuccess(depsNode, taskCode)) {
return DependResult.FAILED;
}
}
}
logger.nfo("taskCode: {} completeDependTaskLst: {}", taskCode, Arrays.toStrng(completeTaskMap.keySet().toArray()));
return DependResult.SUCCESS;
}
/**
* Ths functon s specally used to handle the dependency stuaton where the parent node s a prohbted node.
* When the parent node s a forbdden node, the dependency relatonshp should contnue to be traced
*
* @param taskCode taskCode
* @param ndrectDepCodeLst All ndrectly dependent nodes
*/
prvate vod setIndrectDepLst(Strng taskCode, Lst<Strng> ndrectDepCodeLst) {
TaskNode taskNode = dag.getNode(taskCode);
Lst<Strng> depCodeLst = taskNode.getDepLst();
for (Strng depsNode : depCodeLst) {
f (forbddenTaskMap.contansKey(Long.parseLong(depsNode))) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | setIndrectDepLst(depsNode, ndrectDepCodeLst);
} else {
ndrectDepCodeLst.add(depsNode);
}
}
}
/**
* depend node s completed, but here need check the condton task branch s the next node
*/
prvate boolean dependTaskSuccess(Strng dependNodeName, Strng nextNodeName) {
f (dag.getNode(dependNodeName).sCondtonsTask()) {
Lst<Strng> nextTaskLst = DagHelper.parseCondtonTask(dependNodeName, skpTaskNodeMap, dag, getCompleteTaskInstanceMap());
f (!nextTaskLst.contans(nextNodeName)) {
return false;
}
} else {
long taskCode = Long.parseLong(dependNodeName);
Integer taskInstanceId = completeTaskMap.get(taskCode);
ExecutonStatus depTaskState = taskInstanceMap.get(taskInstanceId).getState();
f (depTaskState.typeIsFalure()) {
return false;
}
}
return true;
}
/**
* query task nstance by complete state
*
* @param state state |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @return task nstance lst
*/
prvate Lst<TaskInstance> getCompleteTaskByState(ExecutonStatus state) {
Lst<TaskInstance> resultLst = new ArrayLst<>();
for (Integer taskInstanceId : completeTaskMap.values()) {
TaskInstance taskInstance = taskInstanceMap.get(taskInstanceId);
f (taskInstance != null && taskInstance.getState() == state) {
resultLst.add(taskInstance);
}
}
return resultLst;
}
/**
* where there are ongong tasks
*
* @param state state
* @return ExecutonStatus
*/
prvate ExecutonStatus runnngState(ExecutonStatus state) {
f (state == ExecutonStatus.READY_STOP
|| state == ExecutonStatus.READY_PAUSE
|| state == ExecutonStatus.WAITING_THREAD
|| state == ExecutonStatus.DELAY_EXECUTION) {
return state;
} else {
return ExecutonStatus.RUNNING_EXECUTION;
}
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * exsts falure task,contans submt falure、dependency falure,execute falure(retry after)
*
* @return Boolean whether has faled task
*/
prvate boolean hasFaledTask() {
f (ths.taskFaledSubmt) {
return true;
}
f (ths.errorTaskMap.sze() > 0) {
return true;
}
return ths.dependFaledTaskMap.sze() > 0;
}
/**
* process nstance falure
*
* @return Boolean whether process nstance faled
*/
prvate boolean processFaled() {
f (hasFaledTask()) {
f (processInstance.getFalureStrategy() == FalureStrategy.END) {
return true;
}
f (processInstance.getFalureStrategy() == FalureStrategy.CONTINUE) {
return readyToSubmtTaskQueue.sze() == 0
&& actveTaskProcessorMaps.sze() == 0
&& watToRetryTaskInstanceMap.sze() == 0;
}
}
return false; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* whether task for watng thread
*
* @return Boolean whether has watng thread task
*/
prvate boolean hasWatngThreadTask() {
Lst<TaskInstance> watngLst = getCompleteTaskByState(ExecutonStatus.WAITING_THREAD);
return CollectonUtls.sNotEmpty(watngLst);
}
/**
* prepare for pause
* 1,faled retry task n the preparaton queue , returns to falure drectly
* 2,exsts pause task,complement not completed, pendng submsson of tasks, return to suspenson
* 3,success
*
* @return ExecutonStatus
*/
prvate ExecutonStatus processReadyPause() {
f (hasRetryTaskInStandBy()) {
return ExecutonStatus.FAILURE;
}
Lst<TaskInstance> pauseLst = getCompleteTaskByState(ExecutonStatus.PAUSE);
f (CollectonUtls.sNotEmpty(pauseLst)
|| !sComplementEnd()
|| readyToSubmtTaskQueue.sze() > 0) {
return ExecutonStatus.PAUSE;
} else {
return ExecutonStatus.SUCCESS;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* generate the latest process nstance status by the tasks state
*
* @return process nstance executon status
*/
prvate ExecutonStatus getProcessInstanceState(ProcessInstance nstance) {
ExecutonStatus state = nstance.getState();
f (actveTaskProcessorMaps.sze() > 0 || hasRetryTaskInStandBy()) {
// actve
return runnngState(state);
}
// watng thread
f (hasWatngThreadTask()) {
return ExecutonStatus.WAITING_THREAD;
}
// pause
f (state == ExecutonStatus.READY_PAUSE) {
return processReadyPause();
}
// stop
f (state == ExecutonStatus.READY_STOP) {
Lst<TaskInstance> stopLst = getCompleteTaskByState(ExecutonStatus.STOP);
Lst<TaskInstance> kllLst = getCompleteTaskByState(ExecutonStatus.KILL);
Lst<TaskInstance> falLst = getCompleteTaskByState(ExecutonStatus.FAILURE);
f (CollectonUtls.sNotEmpty(stopLst)
|| CollectonUtls.sNotEmpty(kllLst)
|| CollectonUtls.sNotEmpty(falLst)
|| !sComplementEnd()) {
return ExecutonStatus.STOP; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | } else {
return ExecutonStatus.SUCCESS;
}
}
// process falure
f (processFaled()) {
return ExecutonStatus.FAILURE;
}
// success
f (state == ExecutonStatus.RUNNING_EXECUTION) {
Lst<TaskInstance> kllTasks = getCompleteTaskByState(ExecutonStatus.KILL);
f (readyToSubmtTaskQueue.sze() > 0 || watToRetryTaskInstanceMap.sze() > 0) {
//tasks cu
return ExecutonStatus.RUNNING_EXECUTION;
} else f (CollectonUtls.sNotEmpty(kllTasks)) {
// tasks m
return ExecutonStatus.FAILURE;
} else {
// f the
return ExecutonStatus.SUCCESS;
}
}
return state;
}
/**
* whether complement end
*
* @return Boolean whether s complement end
*/
prvate boolean sComplementEnd() { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (!processInstance.sComplementData()) {
return true;
}
try {
Map<Strng, Strng> cmdParam = JSONUtls.toMap(processInstance.getCommandParam());
Date endTme = DateUtls.getScheduleDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE));
return processInstance.getScheduleTme().equals(endTme);
} catch (Excepton e) {
logger.error("complement end faled ", e);
return false;
}
}
/**
* updateProcessInstance process nstance state
* after each batch of tasks s executed, the status of the process nstance s updated
*/
prvate vod updateProcessInstanceState() {
ExecutonStatus state = getProcessInstanceState(processInstance);
f (processInstance.getState() != state) {
logger.nfo(
"work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}",
processInstance.getId(), processInstance.getName(),
processInstance.getState(), state,
processInstance.getCommandType());
processInstance.setState(state);
f (state.typeIsFnshed()) {
processInstance.setEndTme(new Date());
}
processServce.updateProcessInstance(processInstance);
StateEvent stateEvent = new StateEvent(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | stateEvent.setExecutonStatus(processInstance.getState());
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setType(StateEventType.PROCESS_STATE_CHANGE);
ths.processStateChangeHandler(stateEvent);
}
}
/**
* stateEvent's executon status as process nstance state
*/
prvate vod updateProcessInstanceState(StateEvent stateEvent) {
ExecutonStatus state = stateEvent.getExecutonStatus();
f (processInstance.getState() != state) {
logger.nfo(
"work flow process nstance [d: {}, name:{}], state change from {} to {}, cmd type: {}",
processInstance.getId(), processInstance.getName(),
processInstance.getState(), state,
processInstance.getCommandType());
processInstance.setState(state);
f (state.typeIsFnshed()) {
processInstance.setEndTme(new Date());
}
processServce.updateProcessInstance(processInstance);
}
}
/**
* get task dependency result
*
* @param taskInstance task nstance
* @return DependResult
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate DependResult getDependResultForTask(TaskInstance taskInstance) {
return sTaskDepsComplete(Long.toStrng(taskInstance.getTaskCode()));
}
/**
* add task to standby lst
*
* @param taskInstance task nstance
*/
prvate vod addTaskToStandByLst(TaskInstance taskInstance) {
try {
f (readyToSubmtTaskQueue.contans(taskInstance)) {
logger.warn("task was found n ready submt queue, task code:{}", taskInstance.getTaskCode());
return;
}
// need to
boolean actve = hadNotFalTask(taskInstance.getTaskCode(), taskInstance.getTaskDefntonVerson());
f (actve) {
logger.warn("task was found n actve task lst, task code:{}", taskInstance.getTaskCode());
return;
}
logger.nfo("add task to stand by lst, task name:{}, task d:{}, task code:{}",
taskInstance.getName(), taskInstance.getId(), taskInstance.getTaskCode());
readyToSubmtTaskQueue.put(taskInstance);
} catch (Excepton e) {
logger.error("add task nstance to readyToSubmtTaskQueue, taskName:{}, task d:{}", taskInstance.getName(), taskInstance.getId(), e);
}
}
/**
* remove task from stand by lst
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * @param taskInstance task nstance
*/
prvate vod removeTaskFromStandbyLst(TaskInstance taskInstance) {
logger.nfo("remove task from stand by lst, d: {} name:{}",
taskInstance.getId(),
taskInstance.getName());
try {
readyToSubmtTaskQueue.remove(taskInstance);
} catch (Excepton e) {
logger.error("remove task nstance from readyToSubmtTaskQueue error, task d:{}, Name: {}",
taskInstance.getId(),
taskInstance.getName(), e);
}
}
/**
* has retry task n standby
*
* @return Boolean whether has retry task n standby
*/
prvate boolean hasRetryTaskInStandBy() {
for (Iterator<TaskInstance> ter = readyToSubmtTaskQueue.terator(); ter.hasNext(); ) {
f (ter.next().getState().typeIsFalure()) {
return true;
}
}
return false;
}
/**
* close the on gong tasks
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | prvate vod kllAllTasks() {
logger.nfo("kll called on process nstance d: {}, num: {}", processInstance.getId(),
actveTaskProcessorMaps.sze());
f (readyToSubmtTaskQueue.sze() > 0) {
readyToSubmtTaskQueue.clear();
}
for (long taskCode : actveTaskProcessorMaps.keySet()) {
ITaskProcessor taskProcessor = actveTaskProcessorMaps.get(taskCode);
Integer taskInstanceId = valdTaskMap.get(taskCode);
f (taskInstanceId == null || taskInstanceId.equals(0)) {
contnue;
}
TaskInstance taskInstance = processServce.fndTaskInstanceById(taskInstanceId);
f (taskInstance == null || taskInstance.getState().typeIsFnshed()) {
contnue;
}
taskProcessor.acton(TaskActon.STOP);
f (taskProcessor.taskInstance().getState().typeIsFnshed()) {
StateEvent stateEvent = new StateEvent();
stateEvent.setType(StateEventType.TASK_STATE_CHANGE);
stateEvent.setProcessInstanceId(ths.processInstance.getId());
stateEvent.setTaskInstanceId(taskInstance.getId());
stateEvent.setExecutonStatus(taskProcessor.taskInstance().getState());
ths.addStateEvent(stateEvent);
}
}
}
publc boolean workFlowFnsh() {
return ths.processInstance.getState().typeIsFnshed();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | /**
* handlng the lst of tasks to be submtted
*/
prvate vod submtStandByTask() {
try {
nt length = readyToSubmtTaskQueue.sze();
for (nt = 0; < length; ++) {
TaskInstance task = readyToSubmtTaskQueue.peek();
f (task == null) {
contnue;
}
// stop ta
f (task.taskCanRetry()) {
TaskInstance retryTask = processServce.fndTaskInstanceById(task.getId());
f (retryTask != null && retryTask.getState().equals(ExecutonStatus.FORCED_SUCCESS)) {
task.setState(retryTask.getState());
logger.nfo("task: {} has been forced success, put t nto complete task lst and stop retryng", task.getName());
removeTaskFromStandbyLst(task);
completeTaskMap.put(task.getTaskCode(), task.getId());
taskInstanceMap.put(task.getId(), task);
submtPostNode(Long.toStrng(task.getTaskCode()));
contnue;
}
}
//nt var
f (task.sFrstRun()) {
//get pre
Set<Strng> preTask = dag.getPrevousNodes(Long.toStrng(task.getTaskCode()));
getPreVarPool(task, preTask);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | DependResult dependResult = getDependResultForTask(task);
f (DependResult.SUCCESS == dependResult) {
TaskInstance taskInstance = submtTaskExec(task);
f (taskInstance == null) {
ths.taskFaledSubmt = true;
} else {
removeTaskFromStandbyLst(task);
}
} else f (DependResult.FAILED == dependResult) {
// f the
dependFaledTaskMap.put(task.getTaskCode(), task.getId());
removeTaskFromStandbyLst(task);
logger.nfo("task {},d:{} depend result : {}", task.getName(), task.getId(), dependResult);
} else f (DependResult.NON_EXEC == dependResult) {
// for som
removeTaskFromStandbyLst(task);
logger.nfo("remove task {},d:{} , because depend result : {}", task.getName(), task.getId(), dependResult);
}
}
} catch (Excepton e) {
logger.error("submt standby task error", e);
}
}
/**
* get recovery task nstance lst
*
* @param taskIdArray task d array
* @return recovery task nstance lst
*/
prvate Lst<TaskInstance> getRecoverTaskInstanceLst(Strng[] taskIdArray) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | f (taskIdArray == null || taskIdArray.length == 0) {
return new ArrayLst<>();
}
Lst<Integer> taskIdLst = new ArrayLst<>(taskIdArray.length);
for (Strng taskId : taskIdArray) {
try {
Integer d = Integer.valueOf(taskId);
taskIdLst.add(d);
} catch (Excepton e) {
logger.error("get recovery task nstance faled ", e);
}
}
return processServce.fndTaskInstanceByIdLst(taskIdLst);
}
/**
* get start task nstance lst
*
* @param cmdParam command param
* @return task nstance lst
*/
prvate Lst<TaskInstance> getStartTaskInstanceLst(Strng cmdParam) {
Lst<TaskInstance> nstanceLst = new ArrayLst<>();
Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam);
f (paramMap != null && paramMap.contansKey(CMD_PARAM_RECOVERY_START_NODE_STRING)) {
Strng[] dLst = paramMap.get(CMD_PARAM_RECOVERY_START_NODE_STRING).splt(Constants.COMMA);
nstanceLst = getRecoverTaskInstanceLst(dLst);
}
return nstanceLst;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * parse "StartNodeNameLst" from cmd param
*
* @param cmdParam command param
* @return start node name lst
*/
prvate Lst<Strng> parseStartNodeName(Strng cmdParam) {
Lst<Strng> startNodeNameLst = new ArrayLst<>();
Map<Strng, Strng> paramMap = JSONUtls.toMap(cmdParam);
f (paramMap == null) {
return startNodeNameLst;
}
f (paramMap.contansKey(CMD_PARAM_START_NODES)) {
startNodeNameLst = Arrays.asLst(paramMap.get(CMD_PARAM_START_NODES).splt(Constants.COMMA));
}
return startNodeNameLst;
}
/**
* generate start node code lst from parsng command param;
* f "StartNodeIdLst" exsts n command param, return StartNodeIdLst
*
* @return recovery node code lst
*/
prvate Lst<Strng> getRecoveryNodeCodeLst(Lst<TaskInstance> recoverNodeLst) {
Lst<Strng> recoveryNodeCodeLst = new ArrayLst<>();
f (CollectonUtls.sNotEmpty(recoverNodeLst)) {
for (TaskInstance task : recoverNodeLst) {
recoveryNodeCodeLst.add(Long.toStrng(task.getTaskCode()));
}
}
return recoveryNodeCodeLst; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | }
/**
* generate flow dag
*
* @param totalTaskNodeLst total task node lst
* @param startNodeNameLst start node name lst
* @param recoveryNodeCodeLst recovery node code lst
* @param depNodeType depend node type
* @return ProcessDag process dag
* @throws Excepton excepton
*/
publc ProcessDag generateFlowDag(Lst<TaskNode> totalTaskNodeLst,
Lst<Strng> startNodeNameLst,
Lst<Strng> recoveryNodeCodeLst,
TaskDependType depNodeType) throws Excepton {
return DagHelper.generateFlowDag(totalTaskNodeLst, startNodeNameLst, recoveryNodeCodeLst, depNodeType);
}
/**
* check task queue
*/
prvate boolean checkTaskQueue() {
AtomcBoolean result = new AtomcBoolean(false);
taskInstanceMap.forEach((d, taskInstance) -> {
f (taskInstance != null && taskInstance.getTaskGroupId() > 0) {
result.set(true);
}
});
return result.get();
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,506 | [Bug] [Master] process instance stop result wrong | ### 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
1. Stop a process instance which task instance can not find worker group. The state of the stop process instance is success. If taskInstance.getHost() is empty it will cause WorkflowExecuteThread.taskInstanceMap's taskInstance state wrong In ```org.apache.dolphinscheduler.server.master.runner.task.CommonTaskProcessor#killTask```.
2. Stop a process instance which task instance state is running. The state of the stop process instance is success.
3. When a downstream user uses a dependent node, if the result of kill command is success, the dependent node will judge that the execution is successful. In fact, the execution fails, resulting in an error in the detection result of the dependent node.
### What you expected to happen
The state of the stop process instance is stop.
### How to reproduce
1. Stop a process instance which task instance can not find worker group.
2. Stop a process instance which task instance state is running.
### Anything else
_No response_
### Version
dev
### 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/8506 | https://github.com/apache/dolphinscheduler/pull/8529 | 3cfb3270fe2dbe3b009c307ce31881c772c24eee | 74afdcf8f315eb84ba1a87386e4ebab7767c6b35 | 2022-02-23T09:45:07Z | java | 2022-03-01T07:20:02Z | dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java | * s new process nstance
*/
prvate boolean sNewProcessInstance() {
f (ExecutonStatus.RUNNING_EXECUTION == processInstance.getState() && processInstance.getRunTmes() == 1) {
return true;
} else {
return false;
}
}
/**
* check f had not fal task by taskCode and verson
* @param taskCode
* @param verson
* @return
*/
prvate boolean hadNotFalTask(long taskCode, nt verson) {
boolean result = false;
for (Entry<Integer, TaskInstance> entry : taskInstanceMap.entrySet()) {
TaskInstance taskInstance = entry.getValue();
f (taskInstance.getTaskCode() == taskCode && taskInstance.getTaskDefntonVerson() == verson) {
f (!taskInstance.getState().typeIsFalure()) {
result = true;
break;
}
}
}
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.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 | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | */
package org.apache.dolphinscheduler.api.service.impl;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.TaskGroupQueueService;
import org.apache.dolphinscheduler.api.service.TaskGroupService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.dao.entity.TaskGroup;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.TaskGroupMapper;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.spi.utils.StringUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* task Group Service
*/
@Service
public class TaskGroupServiceImpl extends BaseServiceImpl implements TaskGroupService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | @Autowired
private TaskGroupMapper taskGroupMapper;
@Autowired
private TaskGroupQueueService taskGroupQueueService;
@Autowired
private ProcessService processService;
private static final Logger logger = LoggerFactory.getLogger(TaskGroupServiceImpl.class);
/**
* create a Task group
*
* @param loginUser login user
* @param name task group name
* @param description task group description
* @param groupSize task group total size
* @return the result code and msg
*/
@Override
public Map<String, Object> createTaskGroup(User loginUser, Long projectCode, String name, String description, int groupSize) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
if (name == null) {
putMsg(result, Status.NAME_NULL);
return result;
}
if (groupSize <= 0) {
putMsg(result, Status.TASK_GROUP_SIZE_ERROR);
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | TaskGroup taskGroup1 = taskGroupMapper.queryByName(loginUser.getId(), name);
if (taskGroup1 != null) {
putMsg(result, Status.TASK_GROUP_NAME_EXSIT);
return result;
}
TaskGroup taskGroup = new TaskGroup(name, projectCode, description,
groupSize, loginUser.getId(), Flag.YES.getCode());
taskGroup.setCreateTime(new Date());
taskGroup.setUpdateTime(new Date());
if (taskGroupMapper.insert(taskGroup) > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.CREATE_TASK_GROUP_ERROR);
return result;
}
return result;
}
/**
* update the task group
*
* @param loginUser login user
* @param name task group name
* @param description task group description
* @param groupSize task group total size
* @return the result code and msg
*/
@Override
public Map<String, Object> updateTaskGroup(User loginUser, int id, String name, String description, int groupSize) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | return result;
}
if (name == null) {
putMsg(result, Status.NAME_NULL);
return result;
}
if (groupSize <= 0) {
putMsg(result, Status.TASK_GROUP_SIZE_ERROR);
return result;
}
Integer exists = taskGroupMapper.selectCount(new QueryWrapper<TaskGroup>().lambda().eq(TaskGroup::getName, name).ne(TaskGroup::getId, id));
if (exists > 0) {
putMsg(result, Status.TASK_GROUP_NAME_EXSIT);
return result;
}
TaskGroup taskGroup = taskGroupMapper.selectById(id);
if (taskGroup.getStatus() != Flag.YES.getCode()) {
putMsg(result, Status.TASK_GROUP_STATUS_ERROR);
return result;
}
taskGroup.setGroupSize(groupSize);
taskGroup.setDescription(description);
taskGroup.setUpdateTime(new Date());
if (StringUtils.isNotEmpty(name)) {
taskGroup.setName(name);
}
int i = taskGroupMapper.updateById(taskGroup);
logger.info("update result:{}", i);
putMsg(result, Status.SUCCESS);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | }
/**
* get task group status
*
* @param id task group id
* @return is the task group available
*/
@Override
public boolean isTheTaskGroupAvailable(int id) {
return taskGroupMapper.selectCountByIdStatus(id, Flag.YES.getCode()) == 1;
}
/**
* query all task group by user id
*
* @param loginUser login user
* @param pageNo page no
* @param pageSize page size
* @return the result code and msg
*/
@Override
public Map<String, Object> queryAllTaskGroup(User loginUser, String name, Integer status, int pageNo, int pageSize) {
return this.doQuery(loginUser, pageNo, pageSize, loginUser.getId(), name, status);
}
/**
* query all task group by status
*
* @param loginUser login user
* @param pageNo page no
* @param pageSize page size
* @param status status |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | * @return the result code and msg
*/
@Override
public Map<String, Object> queryTaskGroupByStatus(User loginUser, int pageNo, int pageSize, int status) {
return this.doQuery(loginUser, pageNo, pageSize, loginUser.getId(), null, status);
}
/**
* query all task group by name
*
* @param loginUser login user
* @param pageNo page no
* @param pageSize page size
* @param projectCode project code
* @return the result code and msg
*/
@Override
public Map<String, Object> queryTaskGroupByProjectCode(User loginUser, int pageNo, int pageSize, Long projectCode) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
Page<TaskGroup> page = new Page<>(pageNo, pageSize);
IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPagingByProjectCode(page, projectCode);
return getStringObjectMap(pageNo, pageSize, result, taskGroupPaging);
}
private Map<String, Object> getStringObjectMap(int pageNo, int pageSize, Map<String, Object> result, IPage<TaskGroup> taskGroupPaging) {
PageInfo<TaskGroup> pageInfo = new PageInfo<>(pageNo, pageSize);
int total = taskGroupPaging == null ? 0 : (int) taskGroupPaging.getTotal();
List<TaskGroup> list = taskGroupPaging == null ? new ArrayList<TaskGroup>() : taskGroupPaging.getRecords();
pageInfo.setTotal(total); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | pageInfo.setTotalList(list);
result.put(Constants.DATA_LIST, pageInfo);
logger.info("select result:{}", taskGroupPaging);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query all task group by id
*
* @param loginUser login user
* @param id id
* @return the result code and msg
*/
@Override
public Map<String, Object> queryTaskGroupById(User loginUser, int id) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
TaskGroup taskGroup = taskGroupMapper.selectById(id);
result.put(Constants.DATA_LIST, taskGroup);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query
*
* @param pageNo page no
* @param pageSize page size
* @param userId user id |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | * @param name name
* @param status status
* @return the result code and msg
*/
@Override
public Map<String, Object> doQuery(User loginUser, int pageNo, int pageSize, int userId, String name, Integer status) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
Page<TaskGroup> page = new Page<>(pageNo, pageSize);
IPage<TaskGroup> taskGroupPaging = taskGroupMapper.queryTaskGroupPaging(page, userId, name, status);
return getStringObjectMap(pageNo, pageSize, result, taskGroupPaging);
}
/**
* close a task group
*
* @param loginUser login user
* @param id task group id
* @return the result code and msg
*/
@Override
public Map<String, Object> closeTaskGroup(User loginUser, int id) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
TaskGroup taskGroup = taskGroupMapper.selectById(id);
if (taskGroup.getStatus() == Flag.NO.getCode()) {
putMsg(result, Status.TASK_GROUP_STATUS_CLOSED); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | return result;
}
taskGroup.setStatus(Flag.NO.getCode());
taskGroupMapper.updateById(taskGroup);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* start a task group
*
* @param loginUser login user
* @param id task group id
* @return the result code and msg
*/
@Override
public Map<String, Object> startTaskGroup(User loginUser, int id) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
TaskGroup taskGroup = taskGroupMapper.selectById(id);
if (taskGroup.getStatus() == Flag.YES.getCode()) {
putMsg(result, Status.TASK_GROUP_STATUS_OPENED);
return result;
}
taskGroup.setStatus(Flag.YES.getCode());
taskGroup.setUpdateTime(new Date(System.currentTimeMillis()));
int update = taskGroupMapper.updateById(taskGroup);
putMsg(result, Status.SUCCESS);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskGroupServiceImpl.java | }
/**
* wake a task manually
*
* @param loginUser
* @param queueId task group queue id
* @return result
*/
@Override
public Map<String, Object> forceStartTask(User loginUser, int queueId) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
taskGroupQueueService.forceStartTask(queueId, Flag.YES.getCode());
putMsg(result, Status.SUCCESS);
return result;
}
@Override
public Map<String, Object> modifyPriority(User loginUser, Integer queueId, Integer priority) {
Map<String, Object> result = new HashMap<>();
if (isNotAdmin(loginUser, result)) {
return result;
}
taskGroupQueueService.modifyPriority(queueId, priority);
putMsg(result, Status.SUCCESS);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.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;
import org.apache.dolphinscheduler.api.service.WorkFlowLineageService;
import org.apache.dolphinscheduler.common.Constants; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | import org.apache.dolphinscheduler.common.enums.TaskType;
import org.apache.dolphinscheduler.common.model.DependentItem;
import org.apache.dolphinscheduler.common.model.DependentTaskModel;
import org.apache.dolphinscheduler.common.task.dependent.DependentParameters;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessLineage;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.WorkFlowLineage;
import org.apache.dolphinscheduler.dao.entity.WorkFlowRelation;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.WorkFlowLineageMapper;
import org.apache.dolphinscheduler.spi.utils.StringUtils;
import org.apache.curator.shaded.com.google.common.collect.Sets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* work flow lineage service impl
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | public class WorkFlowLineageServiceImpl extends BaseServiceImpl implements WorkFlowLineageService {
@Autowired
private WorkFlowLineageMapper workFlowLineageMapper;
@Autowired
private ProjectMapper projectMapper;
@Autowired
private TaskDefinitionLogMapper taskDefinitionLogMapper;
@Override
public Map<String, Object> queryWorkFlowLineageByName(long projectCode, String workFlowName) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
return result;
}
List<WorkFlowLineage> workFlowLineageList = workFlowLineageMapper.queryWorkFlowLineageByName(projectCode, workFlowName);
result.put(Constants.DATA_LIST, workFlowLineageList);
putMsg(result, Status.SUCCESS);
return result;
}
@Override |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | public Map<String, Object> queryWorkFlowLineageByCode(long projectCode, long workFlowCode) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
return result;
}
Map<Long, WorkFlowLineage> workFlowLineagesMap = new HashMap<>();
Set<WorkFlowRelation> workFlowRelations = new HashSet<>();
Set<Long> sourceWorkFlowCodes = Sets.newHashSet(workFlowCode);
recursiveWorkFlow(projectCode, workFlowLineagesMap, workFlowRelations, sourceWorkFlowCodes);
Map<String, Object> workFlowLists = new HashMap<>();
workFlowLists.put(Constants.WORKFLOW_LIST, workFlowLineagesMap.values());
workFlowLists.put(Constants.WORKFLOW_RELATION_LIST, workFlowRelations);
result.put(Constants.DATA_LIST, workFlowLists);
putMsg(result, Status.SUCCESS);
return result;
}
private void recursiveWorkFlow(long projectCode,
Map<Long, WorkFlowLineage> workFlowLineagesMap,
Set<WorkFlowRelation> workFlowRelations,
Set<Long> sourceWorkFlowCodes) {
for (Long workFlowCode : sourceWorkFlowCodes) {
WorkFlowLineage workFlowLineage = workFlowLineageMapper.queryWorkFlowLineageByCode(projectCode, workFlowCode);
workFlowLineagesMap.put(workFlowCode, workFlowLineage);
List<ProcessLineage> processLineages = workFlowLineageMapper.queryProcessLineageByCode(projectCode, workFlowCode);
List<TaskDefinition> taskDefinitionList = new ArrayList<>();
for (ProcessLineage processLineage : processLineages) {
if (processLineage.getPreTaskCode() > 0) {
taskDefinitionList.add(new TaskDefinition(processLineage.getPreTaskCode(), processLineage.getPreTaskVersion())); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | }
if (processLineage.getPostTaskCode() > 0) {
taskDefinitionList.add(new TaskDefinition(processLineage.getPostTaskCode(), processLineage.getPostTaskVersion()));
}
}
sourceWorkFlowCodes = querySourceWorkFlowCodes(projectCode, workFlowCode, taskDefinitionList);
if (sourceWorkFlowCodes.isEmpty()) {
workFlowRelations.add(new WorkFlowRelation(0L, workFlowCode));
return;
} else {
workFlowLineagesMap.get(workFlowCode).setSourceWorkFlowCode(StringUtils.join(sourceWorkFlowCodes, Constants.COMMA));
sourceWorkFlowCodes.forEach(code -> workFlowRelations.add(new WorkFlowRelation(code, workFlowCode)));
recursiveWorkFlow(projectCode, workFlowLineagesMap, workFlowRelations, sourceWorkFlowCodes);
}
}
}
@Override
public Map<String, Object> queryWorkFlowLineage(long projectCode) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.queryByCode(projectCode);
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
return result;
}
List<ProcessLineage> processLineages = workFlowLineageMapper.queryProcessLineage(projectCode);
Map<Long, WorkFlowLineage> workFlowLineagesMap = new HashMap<>();
Set<WorkFlowRelation> workFlowRelations = new HashSet<>();
if (!processLineages.isEmpty()) {
List<WorkFlowLineage> workFlowLineages = workFlowLineageMapper.queryWorkFlowLineageByLineage(processLineages);
workFlowLineagesMap = workFlowLineages.stream().collect(Collectors.toMap(WorkFlowLineage::getWorkFlowCode, workFlowLineage -> workFlowLineage)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | Map<Long, List<TaskDefinition>> workFlowMap = new HashMap<>();
for (ProcessLineage processLineage : processLineages) {
workFlowMap.compute(processLineage.getProcessDefinitionCode(), (k, v) -> {
if (v == null) {
v = new ArrayList<>();
}
if (processLineage.getPreTaskCode() > 0) {
v.add(new TaskDefinition(processLineage.getPreTaskCode(), processLineage.getPreTaskVersion()));
}
if (processLineage.getPostTaskCode() > 0) {
v.add(new TaskDefinition(processLineage.getPostTaskCode(), processLineage.getPostTaskVersion()));
}
return v;
});
}
for (Entry<Long, List<TaskDefinition>> workFlow : workFlowMap.entrySet()) {
Set<Long> sourceWorkFlowCodes = querySourceWorkFlowCodes(projectCode, workFlow.getKey(), workFlow.getValue());
if (sourceWorkFlowCodes.isEmpty()) {
workFlowRelations.add(new WorkFlowRelation(0L, workFlow.getKey()));
} else {
workFlowLineagesMap.get(workFlow.getKey()).setSourceWorkFlowCode(StringUtils.join(sourceWorkFlowCodes, Constants.COMMA));
sourceWorkFlowCodes.forEach(code -> workFlowRelations.add(new WorkFlowRelation(code, workFlow.getKey())));
}
}
}
Map<String, Object> workFlowLists = new HashMap<>();
workFlowLists.put(Constants.WORKFLOW_LIST, workFlowLineagesMap.values());
workFlowLists.put(Constants.WORKFLOW_RELATION_LIST, workFlowRelations);
result.put(Constants.DATA_LIST, workFlowLists);
putMsg(result, Status.SUCCESS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkFlowLineageServiceImpl.java | return result;
}
private Set<Long> querySourceWorkFlowCodes(long projectCode, long workFlowCode, List<TaskDefinition> taskDefinitionList) {
Set<Long> sourceWorkFlowCodes = new HashSet<>();
if (taskDefinitionList == null || taskDefinitionList.isEmpty()) {
return sourceWorkFlowCodes;
}
List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionList);
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
if (taskDefinitionLog.getProjectCode() == projectCode) {
if (taskDefinitionLog.getTaskType().equals(TaskType.DEPENDENT.getDesc())) {
DependentParameters dependentParameters = JSONUtils.parseObject(taskDefinitionLog.getDependence(), DependentParameters.class);
if (dependentParameters != null) {
List<DependentTaskModel> dependTaskList = dependentParameters.getDependTaskList();
for (DependentTaskModel taskModel : dependTaskList) {
List<DependentItem> dependItemList = taskModel.getDependItemList();
for (DependentItem dependentItem : dependItemList) {
if (dependentItem.getProjectCode() == projectCode && dependentItem.getDefinitionCode() != workFlowCode) {
sourceWorkFlowCodes.add(dependentItem.getDefinitionCode());
}
}
}
}
}
}
}
return sourceWorkFlowCodes;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.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.dao.mapper;
import org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessLineage;
import org.apache.dolphinscheduler.dao.entity.WorkFlowLineage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface WorkFlowLineageMapper { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.java | /**
* queryByName
*
* @param projectCode projectCode
* @param workFlowName workFlowName
* @return WorkFlowLineage list
*/
List<WorkFlowLineage> queryWorkFlowLineageByName(@Param("projectCode") long projectCode, @Param("workFlowName") String workFlowName);
/**
* queryWorkFlowLineageByCode
*
* @param projectCode projectCode
* @param workFlowCode workFlowCode
* @return WorkFlowLineage
*/
WorkFlowLineage queryWorkFlowLineageByCode(@Param("projectCode") long projectCode, @Param("workFlowCode") long workFlowCode);
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,616 | [Bug] [WorkFlowLineage] work flow lineage search result missing data | ### 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


### What you expected to happen
work flow lineage's result is right.
### How to reproduce
above.
### Anything else
_No response_
### Version
dev
### 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/8616 | https://github.com/apache/dolphinscheduler/pull/8684 | 403c672e6d03ebc1282da2dbf1889c4db38fee95 | 2ab8c1ca7d820c8921fa062b0757c9b70b00048c | 2022-03-01T08:11:13Z | java | 2022-03-04T06:05:59Z | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.java | * queryWorkFlowLineageByCode
*
* @param processLineages processLineages
* @return WorkFlowLineage list
*/
List<WorkFlowLineage> queryWorkFlowLineageByLineage(@Param("processLineages") List<ProcessLineage> processLineages);
/**
* queryProcessLineage
*
* @param projectCode projectCode
* @return ProcessLineage list
*/
List<ProcessLineage> queryProcessLineage(@Param("projectCode") long projectCode);
/**
* queryCodeRelation
*
* @param projectCode projectCode
* @param processDefinitionCode processDefinitionCode
* @return ProcessLineage list
*/
List<ProcessLineage> queryProcessLineageByCode(@Param("projectCode") long projectCode,
@Param("processDefinitionCode") long processDefinitionCode);
/**
* query process definition by name
*
* @return dependent process definition
*/
List<DependentProcessDefinition> queryDependentProcessDefinitionByProcessDefinitionCode(@Param("code") long code);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,580 | [Bug][UI Next][V1.0.0-Alpha] Errors that appear in standalone after packaging and compiling. | ### 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
I'm trying to package ```UI-Next``` into the docker image of ```dev``` branch. I try to replace the ```dist``` folder compiled by ```UI-Next``` with the previous version to the ```ui``` folder under the API module. I start the API module to access the domain/dolphinscheduler and get the following errors.

And then I try to remove the absolute path ```/``` in index.html. I got another errors.

Is it that the compatibility of API modules has not been completed?
### What you expected to happen
above.
### How to reproduce
above.
### Anything else
In standalone mode.
### Version
dev
### 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/8580 | https://github.com/apache/dolphinscheduler/pull/8748 | 220ec8f5fb93181c6b0e264b2a8d9f4bcc9785e3 | fc334b7b139960b061e6bb952029627d26f60005 | 2022-02-28T09:51:45Z | java | 2022-03-08T03:09:08Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.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.configuration;
import java.util.Locale;
import org.apache.dolphinscheduler.api.interceptor.LocaleChangeInterceptor;
import org.apache.dolphinscheduler.api.interceptor.LoginHandlerInterceptor;
import org.apache.dolphinscheduler.api.interceptor.RateLimitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,580 | [Bug][UI Next][V1.0.0-Alpha] Errors that appear in standalone after packaging and compiling. | ### 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
I'm trying to package ```UI-Next``` into the docker image of ```dev``` branch. I try to replace the ```dist``` folder compiled by ```UI-Next``` with the previous version to the ```ui``` folder under the API module. I start the API module to access the domain/dolphinscheduler and get the following errors.

And then I try to remove the absolute path ```/``` in index.html. I got another errors.

Is it that the compatibility of API modules has not been completed?
### What you expected to happen
above.
### How to reproduce
above.
### Anything else
In standalone mode.
### Version
dev
### 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/8580 | https://github.com/apache/dolphinscheduler/pull/8748 | 220ec8f5fb93181c6b0e264b2a8d9f4bcc9785e3 | fc334b7b139960b061e6bb952029627d26f60005 | 2022-02-28T09:51:45Z | java | 2022-03-08T03:09:08Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java | import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.CookieLocaleResolver;
/**
* application configuration
*/
@Configuration
public class AppConfiguration implements WebMvcConfigurer {
public static final String LOGIN_INTERCEPTOR_PATH_PATTERN = "/**/*";
public static final String LOGIN_PATH_PATTERN = "/login";
public static final String REGISTER_PATH_PATTERN = "/users/register";
public static final String PATH_PATTERN = "/**";
public static final String LOCALE_LANGUAGE_COOKIE = "language";
@Autowired
private TrafficConfiguration trafficConfiguration;
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");
config.addAllowedMethod("*");
config.addAllowedHeader("*");
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration(PATH_PATTERN, config);
return new CorsFilter(configSource);
}
@Bean
public LoginHandlerInterceptor loginInterceptor() {
return new LoginHandlerInterceptor(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,580 | [Bug][UI Next][V1.0.0-Alpha] Errors that appear in standalone after packaging and compiling. | ### 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
I'm trying to package ```UI-Next``` into the docker image of ```dev``` branch. I try to replace the ```dist``` folder compiled by ```UI-Next``` with the previous version to the ```ui``` folder under the API module. I start the API module to access the domain/dolphinscheduler and get the following errors.

And then I try to remove the absolute path ```/``` in index.html. I got another errors.

Is it that the compatibility of API modules has not been completed?
### What you expected to happen
above.
### How to reproduce
above.
### Anything else
In standalone mode.
### Version
dev
### 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/8580 | https://github.com/apache/dolphinscheduler/pull/8748 | 220ec8f5fb93181c6b0e264b2a8d9f4bcc9785e3 | fc334b7b139960b061e6bb952029627d26f60005 | 2022-02-28T09:51:45Z | java | 2022-03-08T03:09:08Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java | }
/**
* Cookie
* @return local resolver
*/
@Bean(name = "localeResolver")
public LocaleResolver localeResolver() {
CookieLocaleResolver localeResolver = new CookieLocaleResolver();
localeResolver.setCookieName(LOCALE_LANGUAGE_COOKIE);
localeResolver.setDefaultLocale(Locale.US);
localeResolver.setLanguageTagCompliant(false);
return localeResolver;
}
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
return new LocaleChangeInterceptor();
}
@Bean
public RateLimitInterceptor createRateLimitInterceptor() {
return new RateLimitInterceptor(trafficConfiguration);
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(localeChangeInterceptor());
if (trafficConfiguration.isTrafficGlobalControlSwitch() || trafficConfiguration.isTrafficTenantControlSwitch()) {
registry.addInterceptor(createRateLimitInterceptor());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,580 | [Bug][UI Next][V1.0.0-Alpha] Errors that appear in standalone after packaging and compiling. | ### 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
I'm trying to package ```UI-Next``` into the docker image of ```dev``` branch. I try to replace the ```dist``` folder compiled by ```UI-Next``` with the previous version to the ```ui``` folder under the API module. I start the API module to access the domain/dolphinscheduler and get the following errors.

And then I try to remove the absolute path ```/``` in index.html. I got another errors.

Is it that the compatibility of API modules has not been completed?
### What you expected to happen
above.
### How to reproduce
above.
### Anything else
In standalone mode.
### Version
dev
### 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/8580 | https://github.com/apache/dolphinscheduler/pull/8748 | 220ec8f5fb93181c6b0e264b2a8d9f4bcc9785e3 | fc334b7b139960b061e6bb952029627d26f60005 | 2022-02-28T09:51:45Z | java | 2022-03-08T03:09:08Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/AppConfiguration.java | registry.addInterceptor(loginInterceptor())
.addPathPatterns(LOGIN_INTERCEPTOR_PATH_PATTERN)
.excludePathPatterns(LOGIN_PATH_PATTERN, REGISTER_PATH_PATTERN,
"/swagger-resources/**", "/webjars/**", "/v2/**",
"/doc.html", "/swagger-ui.html", "*.html", "/ui/**", "/error");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/ui/**").addResourceLocations("file:ui/");
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/ui/").setViewName("forward:/ui/index.html");
registry.addViewController("/").setViewName("forward:/ui/index.html");
}
/**
* Turn off suffix-based content negotiation
*
* @param configurer configurer
*/
@Override
public void configureContentNegotiation(final ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.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 | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | package org.apache.dolphinscheduler.api.service.impl;
import org.apache.dolphinscheduler.api.dto.resources.ResourceComponent;
import org.apache.dolphinscheduler.api.dto.resources.visitor.ResourceTreeVisitor;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.service.UsersService;
import org.apache.dolphinscheduler.api.utils.CheckUtils;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
import org.apache.dolphinscheduler.dao.entity.DatasourceUser;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.ProjectUser;
import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.ResourcesUser;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.UDFUser;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | import org.apache.dolphinscheduler.dao.mapper.ResourceMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
import org.apache.dolphinscheduler.dao.mapper.UDFUserMapper;
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
import org.apache.dolphinscheduler.dao.utils.ResourceProcessDefinitionUtils;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* users service impl
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
private static final Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class);
@Autowired
private AccessTokenMapper accessTokenMapper;
@Autowired
private UserMapper userMapper;
@Autowired
private TenantMapper tenantMapper;
@Autowired
private ProjectUserMapper projectUserMapper;
@Autowired
private ResourceUserMapper resourceUserMapper;
@Autowired
private ResourceMapper resourceMapper;
@Autowired
private DataSourceUserMapper datasourceUserMapper;
@Autowired
private UDFUserMapper udfUserMapper;
@Autowired
private AlertGroupMapper alertGroupMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private ProjectMapper projectMapper;
/**
* create user, only system admin have permission
*
* @param loginUser login user
* @param userName user name
* @param userPassword user password |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * @param email email
* @param tenantId tenant id
* @param phone phone
* @param queue queue
* @return create result code
* @throws Exception exception
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, Object> createUser(User loginUser,
String userName,
String userPassword,
String email,
int tenantId,
String phone,
String queue,
int state) throws IOException {
Map<String, Object> result = new HashMap<>();
String msg = this.checkUserParams(userName, userPassword, email, phone);
if (!StringUtils.isEmpty(msg)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, msg);
return result;
}
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (!checkTenantExists(tenantId)) {
putMsg(result, Status.TENANT_NOT_EXIST); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | return result;
}
User user = createUser(userName, userPassword, email, tenantId, phone, queue, state);
Tenant tenant = tenantMapper.queryById(tenantId);
if (PropertyUtils.getResUploadStartupState()) {
if (!HadoopUtils.getInstance().exists(HadoopUtils.getHdfsTenantDir(tenant.getTenantCode()))) {
createTenantDirIfNotExists(tenant.getTenantCode());
}
String userPath = HadoopUtils.getHdfsUserDir(tenant.getTenantCode(), user.getId());
HadoopUtils.getInstance().mkdir(userPath);
}
result.put(Constants.DATA_LIST, user);
putMsg(result, Status.SUCCESS);
return result;
}
@Override
@Transactional(rollbackFor = RuntimeException.class)
public User createUser(String userName,
String userPassword,
String email,
int tenantId,
String phone,
String queue,
int state) {
User user = new User();
Date now = new Date();
user.setUserName(userName);
user.setUserPassword(EncryptionUtils.getMd5(userPassword)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | user.setEmail(email);
user.setTenantId(tenantId);
user.setPhone(phone);
user.setState(state);
user.setUserType(UserType.GENERAL_USER);
user.setCreateTime(now);
user.setUpdateTime(now);
if (StringUtils.isEmpty(queue)) {
queue = "";
}
user.setQueue(queue);
userMapper.insert(user);
return user;
}
/***
* create User for ldap login
*/
@Override
@Transactional(rollbackFor = Exception.class)
public User createUser(UserType userType, String userId, String email) {
User user = new User();
Date now = new Date();
user.setUserName(userId);
user.setEmail(email);
user.setUserType(userType);
user.setCreateTime(now);
user.setUpdateTime(now); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | user.setQueue("");
userMapper.insert(user);
return user;
}
/**
* get user by user name
*
* @param userName user name
* @return exist user or null
*/
@Override
public User getUserByUserName(String userName) {
return userMapper.queryByUserNameAccurately(userName);
}
/**
* query user by id
*
* @param id id
* @return user info
*/
@Override
public User queryUser(int id) {
return userMapper.selectById(id);
}
@Override
public List<User> queryUser(List<Integer> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | return userMapper.selectByIds(ids);
}
/**
* query user
*
* @param name name
* @return user info
*/
@Override
public User queryUser(String name) {
return userMapper.queryByUserNameAccurately(name);
}
/**
* query user
*
* @param name name
* @param password password
* @return user info
*/
@Override
public User queryUser(String name, String password) {
String md5 = EncryptionUtils.getMd5(password);
return userMapper.queryUserByNamePassword(name, md5);
}
/**
* get user id by user name
*
* @param name user name
* @return if name empty 0, user not exists -1, user exist user id
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | @Override
public int getUserIdByName(String name) {
int executorId = 0;
if (StringUtils.isNotEmpty(name)) {
User executor = queryUser(name);
if (null != executor) {
executorId = executor.getId();
} else {
executorId = -1;
}
}
return executorId;
}
/**
* query user list
*
* @param loginUser login user
* @param pageNo page number
* @param searchVal search value
* @param pageSize page size
* @return user list page
*/
@Override
public Result queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) {
Result result = new Result();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### 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
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### 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/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | Page<User> page = new Page<>(pageNo, pageSize);
IPage<User> scheduleList = userMapper.queryUserPaging(page, searchVal);
PageInfo<User> pageInfo = new PageInfo<>(pageNo, pageSize);
pageInfo.setTotal((int) scheduleList.getTotal());
pageInfo.setTotalList(scheduleList.getRecords());
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* updateProcessInstance user
*
* @param userId user id
* @param userName user name
* @param userPassword user password
* @param email email
* @param tenantId tenant id
* @param phone phone
* @param queue queue
* @param state state
* @param timeZone timeZone
* @return update result code
* @throws Exception exception
*/
@Override
public Map<String, Object> updateUser(User loginUser, int userId,
String userName,
String userPassword,
String email,
int tenantId, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.