status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
import org.apache.dolphinscheduler.dao.entity.Alert; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.config.NettyServerConfig; import org.apache.dolphinscheduler.spi.utils.StringUtils; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; /** * alert of start */ public class AlertServer { private static final Logger logger = LoggerFactory.getLogger(AlertServer.class); /** * Alert Dao */ private AlertDao alertDao = DaoFactory.getDaoInstance(AlertDao.class); private AlertSender alertSender; private static AlertServer instance; private AlertPluginManager alertPluginManager; private DolphinPluginManagerConfig alertPluginManagerConfig; public static final String ALERT_PLUGIN_BINDING = "alert.plugin.binding"; public static final String ALERT_PLUGIN_DIR = "alert.plugin.dir"; public static final String MAVEN_LOCAL_REPOSITORY = "maven.local.repository"; /** * netty server */ private NettyRemotingServer server; private static class AlertServerHolder {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
private static final AlertServer INSTANCE = new AlertServer(); } public static final AlertServer getInstance() { return AlertServerHolder.INSTANCE; } private AlertServer() { } private void initPlugin() { alertPluginManager = new AlertPluginManager(); alertPluginManagerConfig = new DolphinPluginManagerConfig(); alertPluginManagerConfig.setPlugins(PropertyUtils.getString(ALERT_PLUGIN_BINDING)); if (StringUtils.isNotBlank(PropertyUtils.getString(ALERT_PLUGIN_DIR))) { alertPluginManagerConfig.setInstalledPluginsDir(PropertyUtils.getString(ALERT_PLUGIN_DIR, Constants.ALERT_PLUGIN_PATH).trim()); } if (StringUtils.isNotBlank(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY))) { alertPluginManagerConfig.setMavenLocalRepository(PropertyUtils.getString(MAVEN_LOCAL_REPOSITORY).trim()); } DolphinPluginLoader alertPluginLoader = new DolphinPluginLoader(alertPluginManagerConfig, ImmutableList.of(alertPluginManager)); try { alertPluginLoader.loadPlugins(); } catch (Exception e) { throw new RuntimeException("load Alert Plugin Failed !", e); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
} /** * init netty remoting server */ private void initRemoteServer() { NettyServerConfig serverConfig = new NettyServerConfig(); serverConfig.setListenPort(ALERT_RPC_PORT); this.server = new NettyRemotingServer(serverConfig); this.server.registerProcessor(CommandType.ALERT_SEND_REQUEST, new AlertRequestProcessor(alertDao, alertPluginManager)); this.server.start(); } /** * Cyclic alert info sending alert */ private void runSender() { while (Stopper.isRunning()) { try { Thread.sleep(Constants.ALERT_SCAN_INTERVAL); } catch (InterruptedException e) { logger.error(e.getMessage(), e); Thread.currentThread().interrupt(); } if (alertPluginManager == null || alertPluginManager.getAlertChannelMap().size() == 0) { logger.warn("No Alert Plugin . Can not send alert info. "); } else { List<Alert> alerts = alertDao.listWaitExecutionAlert(); alertSender = new AlertSender(alerts, alertDao, alertPluginManager); alertSender.run(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
} /** * start */ public void start() { PropertyUtils.loadPropertyFile(ALERT_PROPERTIES_PATH); initPlugin(); initRemoteServer(); logger.info("alert server ready start "); runSender(); } /** * stop */ public void stop() { this.server.close(); logger.info("alert server shut down"); } public static void main(String[] args) { AlertServer alertServer = AlertServer.getInstance(); alertServer.start(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { alertServer.stop(); } }); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.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
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
*/ package org.apache.dolphinscheduler.alert; import org.apache.dolphinscheduler.alert.plugin.AlertPluginManager; import org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader; import org.apache.dolphinscheduler.common.plugin.DolphinPluginManagerConfig; import org.apache.dolphinscheduler.alert.runner.AlertSender; import org.apache.dolphinscheduler.alert.utils.Constants; import org.apache.dolphinscheduler.dao.AlertDao; import org.apache.dolphinscheduler.dao.DaoFactory; import org.apache.dolphinscheduler.dao.PluginDao; import org.apache.dolphinscheduler.remote.NettyRemotingServer; import org.apache.dolphinscheduler.spi.alert.AlertChannel; import java.util.concurrent.ConcurrentHashMap; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) @PrepareForTest({AlertServer.class, DaoFactory.class}) public class AlertServerTest { @Before public void before() { } @Test public void testMain() throws Exception { AlertDao alertDao = PowerMockito.mock(AlertDao.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
PowerMockito.mockStatic(DaoFactory.class); PowerMockito.when(DaoFactory.getDaoInstance(AlertDao.class)).thenReturn(alertDao); PluginDao pluginDao = PowerMockito.mock(PluginDao.class); PowerMockito.when(DaoFactory.getDaoInstance(PluginDao.class)).thenReturn(pluginDao); AlertChannel alertChannelMock = PowerMockito.mock(AlertChannel.class); AlertPluginManager alertPluginManager = PowerMockito.mock(AlertPluginManager.class); PowerMockito.whenNew(AlertPluginManager.class).withNoArguments().thenReturn(alertPluginManager); ConcurrentHashMap alertChannelMap = new ConcurrentHashMap<>(); alertChannelMap.put("pluginName", alertChannelMock); PowerMockito.when(alertPluginManager.getPluginNameById(Mockito.anyInt())).thenReturn("pluginName"); PowerMockito.when(alertPluginManager.getAlertChannelMap()).thenReturn(alertChannelMap); DolphinPluginManagerConfig alertPluginManagerConfig = PowerMockito.mock(DolphinPluginManagerConfig.class); PowerMockito.whenNew(DolphinPluginManagerConfig.class).withNoArguments().thenReturn(alertPluginManagerConfig); NettyRemotingServer nettyRemotingServer = PowerMockito.mock(NettyRemotingServer.class); PowerMockito.whenNew(NettyRemotingServer.class).withAnyArguments().thenReturn(nettyRemotingServer); AlertSender alertSender = PowerMockito.mock(AlertSender.class); PowerMockito.whenNew(AlertSender.class).withAnyArguments().thenReturn(alertSender); DolphinPluginLoader dolphinPluginLoader = PowerMockito.mock(DolphinPluginLoader.class); PowerMockito.whenNew(DolphinPluginLoader.class).withAnyArguments().thenReturn(dolphinPluginLoader); AlertServer alertServer = AlertServer.getInstance(); Assert.assertNotNull(alertServer); new Thread(() -> { alertServer.start(); }) .start(); Thread.sleep(5 * Constants.ALERT_SCAN_INTERVAL); alertServer.stop(); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/PluginDao.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; import static java.util.Objects.requireNonNull; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.dao.datasource.ConnectionFactory; import org.apache.dolphinscheduler.dao.entity.PluginDefine; import org.apache.dolphinscheduler.dao.mapper.PluginDefineMapper; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/PluginDao.java
public class PluginDao extends AbstractBaseDao { private final Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private PluginDefineMapper pluginDefineMapper; @Override protected void init() { pluginDefineMapper = ConnectionFactory.getInstance().getMapper(PluginDefineMapper.class); } /** * add pluginDefine * * @param pluginDefine plugin define entiy * @return plugin define id */ public int addPluginDefine(PluginDefine pluginDefine) { return pluginDefineMapper.insert(pluginDefine); } /** * add or update plugin define * * @param pluginDefine new pluginDefine */ public int addOrUpdatePluginDefine(PluginDefine pluginDefine) { requireNonNull(pluginDefine, "pluginDefine is null"); requireNonNull(pluginDefine.getPluginName(), "pluginName is null");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/PluginDao.java
requireNonNull(pluginDefine.getPluginType(), "pluginType is null"); List<PluginDefine> pluginDefineList = pluginDefineMapper.queryByNameAndType(pluginDefine.getPluginName(), pluginDefine.getPluginType()); if (CollectionUtils.isEmpty(pluginDefineList)) { return pluginDefineMapper.insert(pluginDefine); } PluginDefine currPluginDefine = pluginDefineList.get(0); if (!currPluginDefine.getPluginParams().equals(pluginDefine.getPluginParams())) { currPluginDefine.setUpdateTime(pluginDefine.getUpdateTime()); currPluginDefine.setPluginParams(pluginDefine.getPluginParams()); pluginDefineMapper.updateById(currPluginDefine); } return currPluginDefine.getId(); } /** * query plugin define by id * * @param pluginDefineId plugin define id * @return PluginDefine */ public PluginDefine getPluginDefineById(int pluginDefineId) { return pluginDefineMapper.selectById(pluginDefineId); } public PluginDefineMapper getPluginDefineMapper() { return pluginDefineMapper; } public void setPluginDefineMapper(PluginDefineMapper pluginDefineMapper) { this.pluginDefineMapper = pluginDefineMapper; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.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.PluginDefine; import org.apache.ibatis.annotations.Param; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; public interface PluginDefineMapper extends BaseMapper<PluginDefine> {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,386
[Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist
**To Reproduce** Steps to reproduce the behavior, for example: 1. Run `docker-compose up -d` 2. Run `docker logs -f dolphinscheduler-alert` 3. See error **Expected behavior** Bug fixed **Screenshots** Alert logs: ``` [INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk' [INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk -- [INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed ! at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161) Caused by: org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ? ### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 ; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440) at com.sun.proxy.$Proxy11.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61) at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source) at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67) at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99) at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85) at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102) ... 2 more Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist Position: 23 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497) at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) at com.sun.proxy.$Proxy23.query(Unknown Source) at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ... 14 more End start alert-server. 2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected) ``` **Which version of Dolphin Scheduler:** -[dev] **Additional context** Add any other context about the problem here. **Requirement or improvement** - Please describe about your requirements or improvement suggestions.
https://github.com/apache/dolphinscheduler/issues/5386
https://github.com/apache/dolphinscheduler/pull/5387
d45b27ce2e54c972e64d6b00b359643e34c1d2a8
0f3eed9d00e6b688342c7885b0d2fc2528481ce0
"2021-04-25T16:30:21Z"
java
"2021-04-29T08:17:01Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.java
/** * query all plugin define * * @return PluginDefine list */ List<PluginDefine> queryAllPluginDefineList(); /** * query by plugin type * * @param pluginType pluginType * @return PluginDefine list */ List<PluginDefine> queryByPluginType(@Param("pluginType") String pluginType); /** * query detail by id * * @param id id * @return PluginDefineDetail */ PluginDefine queryDetailById(@Param("id") int id); /** * query by name and type * * @param pluginName * @param pluginType * @return */ List<PluginDefine> queryByNameAndType(@Param("pluginName") String pluginName, @Param("pluginType") String pluginType); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,093
[Feature][server] Support for stored procedures and stored function calls and data source supports DB2
**Describe the feature** 1.Support for stored procedures and stored function calls 2. Task node page data source parameters can support the selection of a variety of data sources, rather than currently only limited to mysql, Oracle and other data sources 3. When the calling script is filled in on the page, there will be subtle differences between the calling scripts corresponding to various data sources **Is your feature request related to a problem? Please describe.** 1. Fixed Issues #3990 , data source supports DB2 **Describe the solution you'd like** 1.Support for stored procedures and stored function calls ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2. Task node page selection can support multiple types of data sources, instead of only configuring several data sources like mysql and Oracle 3. Call the script to fill in the page and verify the matching of the number of parameters --- **描述特征** 1.支持存储过程和存储函数调用 2.任务节点页面数据源参数可以支持选择多种类型数据源,而不是现在只限制mysql,oracle等几个数据源 3.调用脚本在页面填写,各个数据源对应的调用脚本会存在细微区别 **您的特性请求与问题有关吗?请描述** 1.修复issues #3990 ,数据源支持DB2 **描述你想要的解决方案** 1.支持存储过程和存储函数调用 ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2.任务节点页面选择可以支持多种类型数据源,而不是现在只配置mysql,oracle等几个数据源 3.调用脚本在页面填写,做参数个数匹配验证
https://github.com/apache/dolphinscheduler/issues/4093
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-11-20T11:10:34Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.worker.task; import org.apache.dolphinscheduler.common.enums.TaskType;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,093
[Feature][server] Support for stored procedures and stored function calls and data source supports DB2
**Describe the feature** 1.Support for stored procedures and stored function calls 2. Task node page data source parameters can support the selection of a variety of data sources, rather than currently only limited to mysql, Oracle and other data sources 3. When the calling script is filled in on the page, there will be subtle differences between the calling scripts corresponding to various data sources **Is your feature request related to a problem? Please describe.** 1. Fixed Issues #3990 , data source supports DB2 **Describe the solution you'd like** 1.Support for stored procedures and stored function calls ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2. Task node page selection can support multiple types of data sources, instead of only configuring several data sources like mysql and Oracle 3. Call the script to fill in the page and verify the matching of the number of parameters --- **描述特征** 1.支持存储过程和存储函数调用 2.任务节点页面数据源参数可以支持选择多种类型数据源,而不是现在只限制mysql,oracle等几个数据源 3.调用脚本在页面填写,各个数据源对应的调用脚本会存在细微区别 **您的特性请求与问题有关吗?请描述** 1.修复issues #3990 ,数据源支持DB2 **描述你想要的解决方案** 1.支持存储过程和存储函数调用 ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2.任务节点页面选择可以支持多种类型数据源,而不是现在只配置mysql,oracle等几个数据源 3.调用脚本在页面填写,做参数个数匹配验证
https://github.com/apache/dolphinscheduler/issues/4093
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-11-20T11:10:34Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
import org.apache.dolphinscheduler.common.utils.EnumUtils; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.worker.task.datax.DataxTask; import org.apache.dolphinscheduler.server.worker.task.flink.FlinkTask; import org.apache.dolphinscheduler.server.worker.task.http.HttpTask; import org.apache.dolphinscheduler.server.worker.task.mr.MapReduceTask; import org.apache.dolphinscheduler.server.worker.task.processdure.ProcedureTask; import org.apache.dolphinscheduler.server.worker.task.python.PythonTask; import org.apache.dolphinscheduler.server.worker.task.shell.ShellTask; import org.apache.dolphinscheduler.server.worker.task.spark.SparkTask; import org.apache.dolphinscheduler.server.worker.task.sql.SqlTask; import org.apache.dolphinscheduler.server.worker.task.sqoop.SqoopTask; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.slf4j.Logger; /** * task manaster */ public class TaskManager { /** * create new task * @param taskExecutionContext taskExecutionContext * @param logger logger * @return AbstractTask * @throws IllegalArgumentException illegal argument exception */ public static AbstractTask newTask(TaskExecutionContext taskExecutionContext, Logger logger, AlertClientService alertClientService) throws IllegalArgumentException { TaskType anEnum = EnumUtils.getEnum(TaskType.class, taskExecutionContext.getTaskType()); if (anEnum == null) { logger.error("not support task type: {}", taskExecutionContext.getTaskType()); throw new IllegalArgumentException("not support task type");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,093
[Feature][server] Support for stored procedures and stored function calls and data source supports DB2
**Describe the feature** 1.Support for stored procedures and stored function calls 2. Task node page data source parameters can support the selection of a variety of data sources, rather than currently only limited to mysql, Oracle and other data sources 3. When the calling script is filled in on the page, there will be subtle differences between the calling scripts corresponding to various data sources **Is your feature request related to a problem? Please describe.** 1. Fixed Issues #3990 , data source supports DB2 **Describe the solution you'd like** 1.Support for stored procedures and stored function calls ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2. Task node page selection can support multiple types of data sources, instead of only configuring several data sources like mysql and Oracle 3. Call the script to fill in the page and verify the matching of the number of parameters --- **描述特征** 1.支持存储过程和存储函数调用 2.任务节点页面数据源参数可以支持选择多种类型数据源,而不是现在只限制mysql,oracle等几个数据源 3.调用脚本在页面填写,各个数据源对应的调用脚本会存在细微区别 **您的特性请求与问题有关吗?请描述** 1.修复issues #3990 ,数据源支持DB2 **描述你想要的解决方案** 1.支持存储过程和存储函数调用 ``` {call <procedure-name>[(<arg1>,<arg2>, ...)]} {?= call <procedure-name>[(<arg1>,<arg2>, ...)]} ``` 2.任务节点页面选择可以支持多种类型数据源,而不是现在只配置mysql,oracle等几个数据源 3.调用脚本在页面填写,做参数个数匹配验证
https://github.com/apache/dolphinscheduler/issues/4093
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-11-20T11:10:34Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
} switch (anEnum) { case SHELL: case WATERDROP: return new ShellTask(taskExecutionContext, logger); case PROCEDURE: return new ProcedureTask(taskExecutionContext, logger); case SQL: return new SqlTask(taskExecutionContext, logger, alertClientService); case MR: return new MapReduceTask(taskExecutionContext, logger); case SPARK: return new SparkTask(taskExecutionContext, logger); case FLINK: return new FlinkTask(taskExecutionContext, logger); case PYTHON: return new PythonTask(taskExecutionContext, logger); case HTTP: return new HttpTask(taskExecutionContext, logger); case DATAX: return new DataxTask(taskExecutionContext, logger); case SQOOP: return new SqoopTask(taskExecutionContext, logger); default: logger.error("not support task type: {}", taskExecutionContext.getTaskType()); throw new IllegalArgumentException("not support task type"); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,990
[Feature][Procedure] Procedure task supports db2 procedure
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the feature** A clear and concise description of what the feature is. Procedure task needs to support db2 procedure **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
https://github.com/apache/dolphinscheduler/issues/3990
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-10-26T01:14:30Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.worker.task; import org.apache.dolphinscheduler.common.enums.TaskType;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,990
[Feature][Procedure] Procedure task supports db2 procedure
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the feature** A clear and concise description of what the feature is. Procedure task needs to support db2 procedure **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
https://github.com/apache/dolphinscheduler/issues/3990
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-10-26T01:14:30Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
import org.apache.dolphinscheduler.common.utils.EnumUtils; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.worker.task.datax.DataxTask; import org.apache.dolphinscheduler.server.worker.task.flink.FlinkTask; import org.apache.dolphinscheduler.server.worker.task.http.HttpTask; import org.apache.dolphinscheduler.server.worker.task.mr.MapReduceTask; import org.apache.dolphinscheduler.server.worker.task.processdure.ProcedureTask; import org.apache.dolphinscheduler.server.worker.task.python.PythonTask; import org.apache.dolphinscheduler.server.worker.task.shell.ShellTask; import org.apache.dolphinscheduler.server.worker.task.spark.SparkTask; import org.apache.dolphinscheduler.server.worker.task.sql.SqlTask; import org.apache.dolphinscheduler.server.worker.task.sqoop.SqoopTask; import org.apache.dolphinscheduler.service.alert.AlertClientService; import org.slf4j.Logger; /** * task manaster */ public class TaskManager { /** * create new task * @param taskExecutionContext taskExecutionContext * @param logger logger * @return AbstractTask * @throws IllegalArgumentException illegal argument exception */ public static AbstractTask newTask(TaskExecutionContext taskExecutionContext, Logger logger, AlertClientService alertClientService) throws IllegalArgumentException { TaskType anEnum = EnumUtils.getEnum(TaskType.class, taskExecutionContext.getTaskType()); if (anEnum == null) { logger.error("not support task type: {}", taskExecutionContext.getTaskType()); throw new IllegalArgumentException("not support task type");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
3,990
[Feature][Procedure] Procedure task supports db2 procedure
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/docs/development/issue.html when describe an issue.* **Describe the feature** A clear and concise description of what the feature is. Procedure task needs to support db2 procedure **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here.
https://github.com/apache/dolphinscheduler/issues/3990
https://github.com/apache/dolphinscheduler/pull/4094
2a59ed092ca1eea733a28f3ceb7f03776582ecb6
88a07f7b55d164b6a022d2f9df75ecbb258c280f
"2020-10-26T01:14:30Z"
java
"2021-04-29T10:29:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/TaskManager.java
} switch (anEnum) { case SHELL: case WATERDROP: return new ShellTask(taskExecutionContext, logger); case PROCEDURE: return new ProcedureTask(taskExecutionContext, logger); case SQL: return new SqlTask(taskExecutionContext, logger, alertClientService); case MR: return new MapReduceTask(taskExecutionContext, logger); case SPARK: return new SparkTask(taskExecutionContext, logger); case FLINK: return new FlinkTask(taskExecutionContext, logger); case PYTHON: return new PythonTask(taskExecutionContext, logger); case HTTP: return new HttpTask(taskExecutionContext, logger); case DATAX: return new DataxTask(taskExecutionContext, logger); case SQOOP: return new SqoopTask(taskExecutionContext, logger); default: logger.error("not support task type: {}", taskExecutionContext.getTaskType()); throw new IllegalArgumentException("not support task type"); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/ConnectionFactory.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/ConnectionFactory.java
* 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 com.alibaba.druid.pool.DruidDataSource; import com.baomidou.mybatisplus.core.MybatisConfiguration; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; import org.apache.dolphinscheduler.common.Constants; import org.apache.ibatis.mapping.Environment; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.transaction.TransactionFactory; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.mybatis.spring.SqlSessionTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.sql.DataSource; /** * not spring manager connection, only use for init db, and alert module for non-spring application * data source connection factory */ public class ConnectionFactory extends SpringConnectionFactory {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/ConnectionFactory.java
private static final Logger logger = LoggerFactory.getLogger(ConnectionFactory.class); private static class ConnectionFactoryHolder { private static final ConnectionFactory connectionFactory = new ConnectionFactory(); } public static ConnectionFactory getInstance() { return ConnectionFactoryHolder.connectionFactory; } private ConnectionFactory() { try { dataSource = buildDataSource(); sqlSessionFactory = getSqlSessionFactory(); sqlSessionTemplate = getSqlSessionTemplate(); } catch (Exception e) { logger.error("Initializing ConnectionFactory error", e); throw new RuntimeException(e); } } /** * sql session factory */ private SqlSessionFactory sqlSessionFactory; /** * sql session template */ private SqlSessionTemplate sqlSessionTemplate; private DataSource dataSource; public DataSource getDataSource() { return dataSource;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/ConnectionFactory.java
} /** * get the data source * * @return druid dataSource */ private DataSource buildDataSource() { DruidDataSource druidDataSource = dataSource(); return druidDataSource; } /** * * get sql session factory * * @return sqlSessionFactory * @throws Exception sqlSessionFactory exception */ private SqlSessionFactory getSqlSessionFactory() throws Exception { TransactionFactory transactionFactory = new JdbcTransactionFactory(); Environment environment = new Environment("development", transactionFactory, getDataSource()); MybatisConfiguration configuration = new MybatisConfiguration(); configuration.setEnvironment(environment); configuration.setLazyLoadingEnabled(true); configuration.addMappers("org.apache.dolphinscheduler.dao.mapper"); configuration.addInterceptor(new PaginationInterceptor()); MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean(); sqlSessionFactoryBean.setConfiguration(configuration); sqlSessionFactoryBean.setDataSource(getDataSource()); sqlSessionFactoryBean.setTypeEnumsPackage("org.apache.dolphinscheduler.*.enums"); sqlSessionFactory = sqlSessionFactoryBean.getObject(); return sqlSessionFactory;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/ConnectionFactory.java
} private SqlSessionTemplate getSqlSessionTemplate() { sqlSessionTemplate = new SqlSessionTemplate(sqlSessionFactory); return sqlSessionTemplate; } /** * get sql session * * @return sqlSession */ public SqlSession getSqlSession() { return sqlSessionTemplate; } /** * get mapper * * @param type target class * @param <T> generic * @return target object */ public <T> T getMapper(Class<T> type) { try { return getSqlSession().getMapper(type); } catch (Exception e) { logger.error(e.getMessage(), e); throw new RuntimeException("get mapper failed"); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
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 static org.apache.dolphinscheduler.common.Constants.DATASOURCE_PROPERTIES; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.utils.PropertyUtils; import org.apache.ibatis.mapping.DatabaseIdProvider; import org.apache.ibatis.mapping.VendorDatabaseIdProvider; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.type.JdbcType; import java.util.Properties; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.slf4j.Logger;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java
import org.slf4j.LoggerFactory; 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.alibaba.druid.pool.DruidDataSource; 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; /** * data source connection factory */ @Configuration @MapperScan("org.apache.dolphinscheduler.*.mapper") public class SpringConnectionFactory { private static final Logger logger = LoggerFactory.getLogger(SpringConnectionFactory.class); static { PropertyUtils.loadPropertyFile(DATASOURCE_PROPERTIES); } /** * pagination interceptor * * @return pagination interceptor */ @Bean public PaginationInterceptor paginationInterceptor() { return new PaginationInterceptor();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java
} /** * get the data source * * @return druid dataSource */ @Bean(destroyMethod = "") public DruidDataSource dataSource() { DruidDataSource druidDataSource = new DruidDataSource(); druidDataSource.setDriverClassName(PropertyUtils.getString(Constants.SPRING_DATASOURCE_DRIVER_CLASS_NAME)); druidDataSource.setUrl(PropertyUtils.getString(Constants.SPRING_DATASOURCE_URL)); druidDataSource.setUsername(PropertyUtils.getString(Constants.SPRING_DATASOURCE_USERNAME)); druidDataSource.setPassword(PropertyUtils.getString(Constants.SPRING_DATASOURCE_PASSWORD)); druidDataSource.setValidationQuery(PropertyUtils.getString(Constants.SPRING_DATASOURCE_VALIDATION_QUERY, "SELECT 1")); druidDataSource.setPoolPreparedStatements(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS, true)); druidDataSource.setTestWhileIdle(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_TEST_WHILE_IDLE, true)); druidDataSource.setTestOnBorrow(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_TEST_ON_BORROW, true)); druidDataSource.setTestOnReturn(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_TEST_ON_RETURN, true)); druidDataSource.setKeepAlive(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_KEEP_ALIVE, true)); druidDataSource.setMinIdle(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MIN_IDLE, 5)); druidDataSource.setMaxActive(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MAX_ACTIVE, 50)); druidDataSource.setMaxWait(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MAX_WAIT, 60000)); druidDataSource.setMaxPoolPreparedStatementPerConnectionSize(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE, 20)); druidDataSource.setInitialSize(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_INITIAL_SIZE, 5)); druidDataSource.setTimeBetweenEvictionRunsMillis(PropertyUtils.getLong(Constants.SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS, 60000)); druidDataSource.setTimeBetweenConnectErrorMillis(PropertyUtils.getLong(Constants.SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS, 60000)); druidDataSource.setMinEvictableIdleTimeMillis(PropertyUtils.getLong(Constants.SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS, 300000)); druidDataSource.setValidationQueryTimeout(PropertyUtils.getInt(Constants.SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT, 3)); druidDataSource.setDefaultAutoCommit(PropertyUtils.getBoolean(Constants.SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT, true));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java
return druidDataSource; } /** * * get transaction manager * * @return DataSourceTransactionManager */ @Bean public DataSourceTransactionManager transactionManager() { return new DataSourceTransactionManager(dataSource()); } /** * * get sql session factory * * @return sqlSessionFactory * @throws Exception sqlSessionFactory exception */ @Bean public SqlSessionFactory sqlSessionFactory() throws Exception { MybatisConfiguration configuration = new MybatisConfiguration(); configuration.setMapUnderscoreToCamelCase(true); configuration.setCacheEnabled(false); configuration.setCallSettersOnNulls(true); configuration.setJdbcTypeForNull(JdbcType.NULL); configuration.addInterceptor(paginationInterceptor()); MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean(); sqlSessionFactoryBean.setConfiguration(configuration); sqlSessionFactoryBean.setDataSource(dataSource()); GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig(); dbConfig.setIdType(IdType.AUTO);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,408
[Improvement][Dao] Database add connection check
**Describe the question** When the database connects fails, the application should fail quickly and shouldn't start successfully. At present, if we set the wrong database params, we can still start the application successful, we need to check the log to determine whether the program is normal. **Which version of DolphinScheduler:** -[1.3.6-release] -[dev] **Describe alternatives you've considered** Do initialize when the database is created
https://github.com/apache/dolphinscheduler/issues/5408
https://github.com/apache/dolphinscheduler/pull/5409
0bdf15efb9774ee11afab61f79d5f5547457e402
71f39fa8751252c9b665213e2f3a4a1827da2a27
"2021-04-29T14:45:12Z"
java
"2021-05-06T01:41:44Z"
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/datasource/SpringConnectionFactory.java
GlobalConfig globalConfig = new GlobalConfig(); 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(); } /** * get sql session * * @return SqlSession */ @Bean public SqlSession sqlSession() throws Exception { return new SqlSessionTemplate(sqlSessionFactory()); } @Bean public DatabaseIdProvider databaseIdProvider() { DatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider(); Properties properties = new Properties(); properties.setProperty("MySQL", "mysql"); properties.setProperty("PostgreSQL", "pg"); databaseIdProvider.setProperties(properties); return databaseIdProvider; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/plugin/DolphinSchedulerPluginLoaderTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.common.plugin; import java.util.Objects; import org.junit.Test; import com.google.common.collect.ImmutableList; public class DolphinSchedulerPluginLoaderTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/plugin/DolphinSchedulerPluginLoaderTest.java
/** * Method: loadPlugins() */ @Test public void testLoadPlugins() { PluginManagerTest pluginManager = new PluginManagerTest(); DolphinPluginManagerConfig alertPluginManagerConfig = new DolphinPluginManagerConfig(); String path = Objects.requireNonNull(DolphinPluginLoader.class.getClassLoader().getResource("")).getPath(); alertPluginManagerConfig.setPlugins(path + "../../../dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/pom.xml"); DolphinPluginLoader alertPluginLoader = new DolphinPluginLoader(alertPluginManagerConfig, ImmutableList.of(pluginManager)); try { alertPluginLoader.loadPlugins(); } catch (Exception e) { throw new RuntimeException("load Alert Plugin Failed !", e); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/* * Licnsd o h Apach Sofwar Foundaion (ASF) undr on or mor * conribuor licns agrmns. S h NOTICE fil disribud wih * his work for addiional informaion rgarding copyrigh ownrship. * Th ASF licnss his fil o You undr h Apach Licns, Vrsion 2.0 * (h "Licns"); you may no us his fil xcp in complianc wih * h Licns. You may obain a copy of h Licns a * * hp://www.apach.org/licnss/LICENSE-2.0 * * Unlss rquird by applicabl law or agrd o in wriing, sofwar * disribud undr h Licns is disribud on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ihr xprss or implid. * S h Licns for h spcic languag govrning prmissions and * limiaions undr h Licns. */ packag org.apach.dolphinschdulr.srvr.masr.runnr;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
impor saic org.apach.dolphinschdulr.common.Consans.CMDPARAM_COMPLEMENT_DATA_END_DATE; impor saic org.apach.dolphinschdulr.common.Consans.CMDPARAM_COMPLEMENT_DATA_START_DATE; impor saic org.apach.dolphinschdulr.common.Consans.CMD_PARAM_RECOVERY_START_NODE_STRING; impor saic org.apach.dolphinschdulr.common.Consans.CMD_PARAM_START_NODE_NAMES; impor saic org.apach.dolphinschdulr.common.Consans.DEFAULT_WORKER_GROUP; impor saic org.apach.dolphinschdulr.common.Consans.LOCAL_PARAMS; impor saic org.apach.dolphinschdulr.common.Consans.SEC_2_MINUTES_TIME_UNIT; impor org.apach.dolphinschdulr.common.Consans; impor org.apach.dolphinschdulr.common.nums.CommandTyp; impor org.apach.dolphinschdulr.common.nums.DpndRsul; impor org.apach.dolphinschdulr.common.nums.Dirc; impor org.apach.dolphinschdulr.common.nums.ExcuionSaus; impor org.apach.dolphinschdulr.common.nums.FailurSragy; impor org.apach.dolphinschdulr.common.nums.Flag; impor org.apach.dolphinschdulr.common.nums.Prioriy; impor org.apach.dolphinschdulr.common.nums.TaskDpndTyp; impor org.apach.dolphinschdulr.common.graph.DAG; impor org.apach.dolphinschdulr.common.modl.TaskNod; impor org.apach.dolphinschdulr.common.modl.TaskNodRlaion; impor org.apach.dolphinschdulr.common.procss.ProcssDag; impor org.apach.dolphinschdulr.common.procss.Propry; impor org.apach.dolphinschdulr.common.hrad.Soppr; impor org.apach.dolphinschdulr.common.hrad.ThradUils; impor org.apach.dolphinschdulr.common.uils.CollcionUils; impor org.apach.dolphinschdulr.common.uils.DaUils; impor org.apach.dolphinschdulr.common.uils.JSONUils; impor org.apach.dolphinschdulr.common.uils.OSUils; impor org.apach.dolphinschdulr.common.uils.ParamrUils; impor org.apach.dolphinschdulr.common.uils.SringUils; impor org.apach.dolphinschdulr.common.uils.VarPoolUils;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
impor org.apach.dolphinschdulr.dao.niy.ProcssInsanc; impor org.apach.dolphinschdulr.dao.niy.ProjcUsr; impor org.apach.dolphinschdulr.dao.niy.Schdul; impor org.apach.dolphinschdulr.dao.niy.TaskInsanc; impor org.apach.dolphinschdulr.dao.uils.DagHlpr; impor org.apach.dolphinschdulr.rmo.NyRmoingClin; impor org.apach.dolphinschdulr.srvr.masr.config.MasrConfig; impor org.apach.dolphinschdulr.srvr.uils.AlrManagr; impor org.apach.dolphinschdulr.srvic.procss.ProcssSrvic; impor org.apach.dolphinschdulr.srvic.quarz.cron.CronUils; impor org.apach.dolphinschdulr.srvic.quu.PrTaskInsancPrioriyQuu; impor java.x.ParsExcpion; impor java.uil.ArrayLis; impor java.uil.Arrays; impor java.uil.Collcion; impor java.uil.Da; impor java.uil.Iraor; impor java.uil.Lis; impor java.uil.Map; impor java.uil.S; impor java.uil.concurrn.ConcurrnHashMap; impor java.uil.concurrn.ExcuorSrvic; impor java.uil.concurrn.Fuur; impor org.slf4j.Loggr; impor org.slf4j.LoggrFacory; impor com.googl.common.collc.Liss; /** * masr xc hrad,spli dag */ public class MasrExcThrad implmns Runnabl {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * loggr of MasrExcThrad */ priva saic final Loggr loggr = LoggrFacory.gLoggr(MasrExcThrad.class); /** * runing TaskNod */ priva final Map<MasrBasTaskExcThrad, Fuur<Boolan>> acivTaskNod = nw ConcurrnHashMap<>(); /** * ask xc srvic */ priva final ExcuorSrvic askExcSrvic; /** * procss insanc */ priva ProcssInsanc procssInsanc;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
/** * submi failur nods */ priva boolan askFaildSubmi = fals; /** * rcovr nod id lis */ priva Lis<TaskInsanc> rcovrNodIdLis = nw ArrayLis<>(); /** * rror ask lis */ priva Map<Sring, TaskInsanc> rrorTaskLis = nw ConcurrnHashMap<>(); /** * compl ask lis */ priva Map<Sring, TaskInsanc> complTaskLis = nw ConcurrnHashMap<>(); /** * rady o submi ask quu */ priva PrTaskInsancPrioriyQuu radyToSubmiTaskQuu = nw PrTaskInsancPrioriyQuu(); /** * dpnd faild ask map */ priva Map<Sring, TaskInsanc> dpndFaildTask = nw ConcurrnHashMap<>(); /** * forbiddn ask map */ priva Map<Sring, TaskNod> forbiddnTaskLis = nw ConcurrnHashMap<>(); /** * skip ask map
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
*/ priva Map<Sring, TaskNod> skipTaskNodLis = nw ConcurrnHashMap<>(); /** * rcovr olranc faul ask lis */ priva Lis<TaskInsanc> rcovrTolrancFaulTaskLis = nw ArrayLis<>(); /** * alr managr */ priva AlrManagr alrManagr; /** * h objc of DAG */ priva DAG<Sring, TaskNod, TaskNodRlaion> dag; /** * procss srvic */ priva ProcssSrvic procssSrvic; /** * masr config */ priva MasrConfig masrConfig; /** * */ priva NyRmoingClin nyRmoingClin; /** * submi pos nod * * @param parnNodNam parn nod nam
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
*/ priva Map<Sring, Objc> propToValu = nw ConcurrnHashMap<Sring, Objc>(); /** * consrucor of MasrExcThrad * * @param procssInsanc procssInsanc * @param procssSrvic procssSrvic * @param nyRmoingClin nyRmoingClin */ public MasrExcThrad(ProcssInsanc procssInsanc , ProcssSrvic procssSrvic , NyRmoingClin nyRmoingClin , AlrManagr alrManagr , MasrConfig masrConfig) { his.procssSrvic = procssSrvic; his.procssInsanc = procssInsanc; his.masrConfig = masrConfig; in masrTaskExcNum = masrConfig.gMasrExcTaskNum(); his.askExcSrvic = ThradUils.nwDamonFixdThradExcuor("Masr-Task-Exc-Thrad", masrTaskExcNum); his.nyRmoingClin = nyRmoingClin; his.alrManagr = alrManagr; } @Ovrrid public void run() { (procssInsanc == null) { loggr.info("procss insanc is no xiss"); rurn; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
(procssInsanc.gSa().ypIsFinishd()) { loggr.info("procss insanc is don : {}", procssInsanc.gId()); rurn; } ry { (procssInsanc.isComplmnDaa() && Flag.NO == procssInsanc.gIsSubProcss()) { xcuComplmnProcss(); } ls { xcuProcss(); } } cach (Excpion ) { loggr.rror("masr xc hrad xcpion", ); loggr.rror("procss xcu faild, procss id:{}", procssInsanc.gId()); procssInsanc.sSa(ExcuionSaus.FAILURE); procssInsanc.sEndTim(nw Da()); procssSrvic.updaProcssInsanc(procssInsanc); } finally { askExcSrvic.shudown(); } } /** * xcu procss * * @hrows Excpion xcpion */ priva void xcuProcss() hrows Excpion { prparProcss();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
runProcss(); ndProcss(); } /** * xcu complmn procss * * @hrows Excpion xcpion */ priva void xcuComplmnProcss() hrows Excpion { Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam()); Da sarDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Da ndDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE)); procssSrvic.savProcssInsanc(procssInsanc); in procssDfiniionId = procssInsanc.gProcssDfiniionId(); Lis<Schdul> schduls = procssSrvic.quryRlasSchdulrLisByProcssDfiniionId(procssDfiniionId); Lis<Da> lisDa = Liss.nwLinkdLis(); (!CollcionUils.isEmpy(schduls)) { for (Schdul schdul : schduls) { lisDa.addAll(CronUils.gSlfFirDaLis(sarDa, ndDa, schdul.gCronab())); } } Iraor<Da> iraor = null; Da schdulDa = null; (!CollcionUils.isEmpy(lisDa)) { iraor = lisDa.iraor(); schdulDa = iraor.nx(); procssInsanc.sSchdulTim(schdulDa); procssSrvic.updaProcssInsanc(procssInsanc);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} ls { schdulDa = procssInsanc.gSchdulTim(); (schdulDa == null) { schdulDa = sarDa; } } whil (Soppr.isRunning()) { loggr.info("procss {} sar o complmn {} daa", procssInsanc.gId(), DaUils.daToSring(schdulDa)); prparProcss(); (dag == null) { loggr.rror("procss {} dag is null, plas chck ou paramrs", procssInsanc.gId()); procssInsanc.sSa(ExcuionSaus.SUCCESS); procssSrvic.updaProcssInsanc(procssInsanc); rurn; } runProcss(); ndProcss(); (!procssInsanc.gSa().ypIsSuccss()) { loggr.info("procss {} sa {}, complmn no complly!", procssInsanc.gId(), procssInsanc.gSa()); brak; } // (null == iraor) { //
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
schdulDa = DaUils.gSomDay(schdulDa, 1); (schdulDa.afr(ndDa)) { // loggr.info("procss {} complmn complly!", procssInsanc.gId()); brak; } } ls { // (!iraor.hasNx()) { // loggr.info("procss {} complmn complly!", procssInsanc.gId()); brak; } schdulDa = iraor.nx(); } // flow nd // procssInsanc.sSchdulTim(schdulDa); (cmdParam.conainsKy(Consans.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.rmov(Consans.CMD_PARAM_RECOVERY_START_NODE_STRING); procssInsanc.sCommandParam(JSONUils.oJsonSring(cmdParam)); } procssInsanc.sSa(ExcuionSaus.RUNNING_EXECUTION); procssInsanc.sGlobalParams(ParamrUils.curingGlobalParams( procssInsanc.gProcssDfiniion().gGlobalParamMap(), procssInsanc.gProcssDfiniion().gGlobalParamLis(), CommandTyp.COMPLEMENT_DATA, procssInsanc.gSchdulTim())); procssInsanc.sId(0); procssInsanc.sSarTim(nw Da()); procssInsanc.sEndTim(null);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
procssSrvic.savProcssInsanc(procssInsanc); } } /** * prpar procss paramr * * @hrows Excpion xcpion */ priva void prparProcss() hrows Excpion { // buildFlowDag(); // iniTaskQuu(); loggr.info("prpar procss :{} nd", procssInsanc.gId()); } /** * procss nd handl */ priva void ndProcss() { procssInsanc.sEndTim(nw Da()); procssSrvic.updaProcssInsanc(procssInsanc); (procssInsanc.gSa().ypIsWaiingThrad()) { procssSrvic.craRcovryWaiingThradCommand(null, procssInsanc); } Lis<TaskInsanc> askInsancs = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId()); ProjcUsr projcUsr = procssSrvic.quryProjcWihUsrByProcssInsancId(procssInsanc.gId()); alrManagr.sndAlrProcssInsanc(procssInsanc, askInsancs, projcUsr); } /** *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* * @hrows Excpion xcpion */ priva void buildFlowDag() hrows Excpion { rcovrNodIdLis = gSarTaskInsancLis(procssInsanc.gCommandParam()); forbiddnTaskLis = DagHlpr.gForbiddnTaskNodMaps(procssInsanc.gProcssInsancJson()); // Lis<Sring> rcovryNamLis = gRcovryNodNamLis(); Lis<Sring> sarNodNamLis = parsSarNodNam(procssInsanc.gCommandParam()); ProcssDag procssDag = gnraFlowDag(procssInsanc.gProcssInsancJson(), sarNodNamLis, rcovryNamLis, procssInsanc.gTaskDpndTyp()); (procssDag == null) { loggr.rror("procssDag is null"); rurn; } // dag = DagHlpr.buildDagGraph(procssDag); } /** * */ priva void iniTaskQuu() { askFaildSubmi = fals; acivTaskNod.clar(); dpndFaildTask.clar(); complTaskLis.clar(); rrorTaskLis.clar(); Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId()); for (TaskInsanc ask : askInsancLis) { (ask.isTaskCompl()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
complTaskLis.pu(ask.gNam(), ask); } (ask.isCondiionsTask() || DagHlpr.havCondiionsAfrNod(ask.gNam(), dag)) { coninu; } (ask.gSa().ypIsFailur() && !ask.askCanRry()) { rrorTaskLis.pu(ask.gNam(), ask); } } } /** * submi ask o xcu * * @param askInsanc ask insanc * @rurn TaskInsanc */ priva TaskInsanc submiTaskExc(TaskInsanc askInsanc) { MasrBasTaskExcThrad absracExcThrad = null; (askInsanc.isSubProcss()) { absracExcThrad = nw SubProcssTaskExcThrad(askInsanc); } ls (askInsanc.isDpndTask()) { absracExcThrad = nw DpndnTaskExcThrad(askInsanc); } ls (askInsanc.isCondiionsTask()) { absracExcThrad = nw CondiionsTaskExcThrad(askInsanc); } ls { absracExcThrad = nw MasrTaskExcThrad(askInsanc); } Fuur<Boolan> fuur = askExcSrvic.submi(absracExcThrad); acivTaskNod.puIfAbsn(absracExcThrad, fuur); rurn absracExcThrad.gTaskInsanc();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} /** * find ask insanc in db. * in cas submi mor han on sam nam ask in h sam im. * * @param askNam ask nam * @rurn TaskInsanc */ priva TaskInsanc findTaskIfExiss(Sring askNam) { Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(his.procssInsanc.gId()); for (TaskInsanc askInsanc : askInsancLis) { (askInsanc.gNam().quals(askNam)) { rurn askInsanc; } } rurn null; } /** * ncapsulaion ask * * @param procssInsanc procss insanc * @param nodNam nod nam * @rurn TaskInsanc */ priva TaskInsanc craTaskInsanc(ProcssInsanc procssInsanc, Sring nodNam, TaskNod askNod) { // his.procssInsanc = his.procssSrvic.findProcssInsancById(his.procssInsanc.gId()); TaskInsanc askInsanc = findTaskIfExiss(nodNam); (askInsanc == null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
askInsanc = nw TaskInsanc(); // ask nam askInsanc.sNam(nodNam); // askInsanc.sProcssDfiniionId(procssInsanc.gProcssDfiniionId()); // askInsanc.sSa(ExcuionSaus.SUBMITTED_SUCCESS); // askInsanc.sProcssInsancId(procssInsanc.gId()); // askInsanc.sTaskJson(JSONUils.oJsonSring(askNod)); // askInsanc.sTaskTyp(askNod.gTyp()); // askInsanc.sAlrFlag(Flag.NO); // askInsanc.sSarTim(null); // askInsanc.sFlag(Flag.YES); // askInsanc.sRryTims(0); // askInsanc.sMaxRryTims(askNod.gMaxRryTims()); // askInsanc.sRryInrval(askNod.gRryInrval()); // (askNod.gTaskInsancPrioriy() == null) { askInsanc.sTaskInsancPrioriy(Prioriy.MEDIUM); } ls { askInsanc.sTaskInsancPrioriy(askNod.gTaskInsancPrioriy());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} Sring procssWorkrGroup = procssInsanc.gWorkrGroup(); procssWorkrGroup = SringUils.isBlank(procssWorkrGroup) ? DEFAULT_WORKER_GROUP : procssWorkrGroup; Sring askWorkrGroup = SringUils.isBlank(askNod.gWorkrGroup()) ? procssWorkrGroup : askNod.gWorkrGroup(); (!procssWorkrGroup.quals(DEFAULT_WORKER_GROUP) && askWorkrGroup.quals(DEFAULT_WORKER_GROUP)) { askInsanc.sWorkrGroup(procssWorkrGroup); } ls { askInsanc.sWorkrGroup(askWorkrGroup); } // sProcssGlobal(askNod, askInsanc); // askInsanc.sDlayTim(askNod.gDlayTim()); } rurn askInsanc; } priva void sProcssGlobal(TaskNod askNod, TaskInsanc askInsanc) { Sring globalParams = his.procssInsanc.gGlobalParams(); (SringUils.isNoEmpy(globalParams)) { Map<Sring, Sring> globalMap = procssSrvic.gGlobalParamMap(globalParams); (globalMap != null && globalMap.siz() != 0) { sGlobalMapToTask(askNod, askInsanc, globalMap); } } } priva void sGlobalMapToTask(TaskNod askNod, TaskInsanc askInsanc, Map<Sring, Sring> globalMap) { // Map<Sring, Objc> rsul = JSONUils.oMap(askNod.gParams(), Sring.class, Objc.class); Objc localParams = rsul.g(LOCAL_PARAMS); (localParams != null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
Lis<Propry> allParam = JSONUils.oLis(JSONUils.oJsonSring(localParams), Propry.class); for (Propry info : allParam) { (info.gDirc().quals(Dirc.IN)) { Sring paramNam = info.gProp(); Sring valu = globalMap.g(paramNam); (SringUils.isNoEmpy(valu)) { info.sValu(valu); } } } rsul.pu(LOCAL_PARAMS, allParam); askNod.sParams(JSONUils.oJsonSring(rsul)); // askInsanc.sTaskJson(JSONUils.oJsonSring(askNod)); } } priva void submiPosNod(Sring parnNodNam) { S<Sring> submiTaskNodLis = DagHlpr.parsPosNods(parnNodNam, skipTaskNodLis, dag, complTaskLis); Lis<TaskInsanc> askInsancs = nw ArrayLis<>(); for (Sring askNod : submiTaskNodLis) { ry { VarPoolUils.convrVarPoolToMap(propToValu, procssInsanc.gVarPool()); } cach (ParsExcpion ) { loggr.rror("pars {} xcpion", procssInsanc.gVarPool(), ); hrow nw RunimExcpion(); } TaskNod askNodObjc = dag.gNod(askNod); VarPoolUils.sTaskNodLocalParams(askNodObjc, propToValu); askInsancs.add(craTaskInsanc(procssInsanc, askNod, askNodObjc));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} // for (TaskInsanc ask : askInsancs) { (radyToSubmiTaskQuu.conains(ask)) { coninu; } (complTaskLis.conainsKy(ask.gNam())) { loggr.info("ask {} has alrady run succss", ask.gNam()); coninu; } (ask.gSa().ypIsPaus() || ask.gSa().ypIsCancl()) { loggr.info("ask {} soppd, h sa is {}", ask.gNam(), ask.gSa()); } ls { addTaskToSandByLis(ask); } } } /** * drmin whhr h dpndncis of h ask nod ar compl * * @rurn DpndRsul */ priva DpndRsul isTaskDpsCompl(Sring askNam) { Collcion<Sring> sarNods = dag.gBginNod(); // (sarNods.conains(askNam)) { rurn DpndRsul.SUCCESS; } TaskNod askNod = dag.gNod(askNam); Lis<Sring> dpNamLis = askNod.gDpLis();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
for (Sring dpsNod : dpNamLis) { (!dag.conainsNod(dpsNod) || forbiddnTaskLis.conainsKy(dpsNod) || skipTaskNodLis.conainsKy(dpsNod)) { coninu; } // (!complTaskLis.conainsKy(dpsNod)) { rurn DpndRsul.WAITING; } ExcuionSaus dpTaskSa = complTaskLis.g(dpsNod).gSa(); (dpTaskSa.ypIsPaus() || dpTaskSa.ypIsCancl()) { rurn DpndRsul.NON_EXEC; } // (askNod.isCondiionsTask()) { coninu; } (!dpndTaskSuccss(dpsNod, askNam)) { rurn DpndRsul.FAILED; } } loggr.info("askNam: {} complDpndTaskLis: {}", askNam, Arrays.oSring(complTaskLis.kyS().oArray())); rurn DpndRsul.SUCCESS; } /** * dpnd nod is compld, bu hr nd chck h condiion ask branch is h nx nod */ priva boolan dpndTaskSuccss(Sring dpndNodNam, Sring nxNodNam) { (dag.gNod(dpndNodNam).isCondiionsTask()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
// Lis<Sring> nxTaskLis = DagHlpr.parsCondiionTask(dpndNodNam, skipTaskNodLis, dag, complTaskLis); (!nxTaskLis.conains(nxNodNam)) { rurn fals; } } ls { ExcuionSaus dpTaskSa = complTaskLis.g(dpndNodNam).gSa(); (dpTaskSa.ypIsFailur()) { rurn fals; } } rurn ru; } /** * qury ask insanc by compl sa * * @param sa sa * @rurn ask insanc lis */ priva Lis<TaskInsanc> gComplTaskBySa(ExcuionSaus sa) { Lis<TaskInsanc> rsulLis = nw ArrayLis<>(); for (Map.Enry<Sring, TaskInsanc> nry : complTaskLis.nryS()) { (nry.gValu().gSa() == sa) { rsulLis.add(nry.gValu()); } } rurn rsulLis; } /** * whr hr ar ongoing asks
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* * @param sa sa * @rurn ExcuionSaus */ priva ExcuionSaus runningSa(ExcuionSaus sa) { (sa == ExcuionSaus.READY_STOP || sa == ExcuionSaus.READY_PAUSE || sa == ExcuionSaus.WAITTING_THREAD || sa == ExcuionSaus.DELAY_EXECUTION) { // rurn sa; } ls { rurn ExcuionSaus.RUNNING_EXECUTION; } } /** * xiss failur ask,conains submi failur、dpndncy failur,xcu failur(rry afr) * * @rurn Boolan whhr has faild ask */ priva boolan hasFaildTask() { (his.askFaildSubmi) { rurn ru; } (his.rrorTaskLis.siz() > 0) { rurn ru; } rurn his.dpndFaildTask.siz() > 0; } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* procss insanc failur * * @rurn Boolan whhr procss insanc faild */ priva boolan procssFaild() { (hasFaildTask()) { (procssInsanc.gFailurSragy() == FailurSragy.END) { rurn ru; } (procssInsanc.gFailurSragy() == FailurSragy.CONTINUE) { rurn radyToSubmiTaskQuu.siz() == 0 || acivTaskNod.siz() == 0; } } rurn fals; } /** * whhr ask for waiing hrad * * @rurn Boolan whhr has waiing hrad ask */ priva boolan hasWaiingThradTask() { Lis<TaskInsanc> waiingLis = gComplTaskBySa(ExcuionSaus.WAITTING_THREAD); rurn CollcionUils.isNoEmpy(waiingLis); } /** * prpar for paus * 1,faild rry ask in h prparaion quu , rurns o failur dircly * 2,xiss paus ask,complmn no compld, pnding submission of asks, rurn o suspnsion * 3,succss *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* @rurn ExcuionSaus */ priva ExcuionSaus procssRadyPaus() { (hasRryTaskInSandBy()) { rurn ExcuionSaus.FAILURE; } Lis<TaskInsanc> pausLis = gComplTaskBySa(ExcuionSaus.PAUSE); (CollcionUils.isNoEmpy(pausLis) || !isComplmnEnd() || radyToSubmiTaskQuu.siz() > 0) { rurn ExcuionSaus.PAUSE; } ls { rurn ExcuionSaus.SUCCESS; } } /** * gnra h las procss insanc saus by h asks sa * * @rurn procss insanc xcuion saus */ priva ExcuionSaus gProcssInsancSa() { ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId()); ExcuionSaus sa = insanc.gSa(); (acivTaskNod.siz() > 0 || hasRryTaskInSandBy()) { // aciv a rurn runningSa(sa); } // procss failur (procssFaild()) { rurn ExcuionSaus.FAILURE;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} // waiing hrad (hasWaiingThradTask()) { rurn ExcuionSaus.WAITTING_THREAD; } // paus (sa == ExcuionSaus.READY_PAUSE) { rurn procssRadyPaus(); } // sop (sa == ExcuionSaus.READY_STOP) { Lis<TaskInsanc> sopLis = gComplTaskBySa(ExcuionSaus.STOP); Lis<TaskInsanc> killLis = gComplTaskBySa(ExcuionSaus.KILL); (CollcionUils.isNoEmpy(sopLis) || CollcionUils.isNoEmpy(killLis) || !isComplmnEnd()) { rurn ExcuionSaus.STOP; } ls { rurn ExcuionSaus.SUCCESS; } } // succss (sa == ExcuionSaus.RUNNING_EXECUTION) { Lis<TaskInsanc> killTasks = gComplTaskBySa(ExcuionSaus.KILL); (radyToSubmiTaskQuu.siz() > 0) { //asks curr rurn ExcuionSaus.RUNNING_EXECUTION; } ls (CollcionUils.isNoEmpy(killTasks)) { // asks may rurn ExcuionSaus.FAILURE;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
} ls { // h w rurn ExcuionSaus.SUCCESS; } } rurn sa; } /** * whhr sandby ask lis hav rry asks */ priva boolan rryTaskExiss() { boolan rsul = fals; for (Iraor<TaskInsanc> ir = radyToSubmiTaskQuu.iraor(); ir.hasNx(); ) { TaskInsanc ask = ir.nx(); (ask.gSa().ypIsFailur()) { rsul = ru; brak; } } rurn rsul; } /** * whhr complmn nd * * @rurn Boolan whhr is complmn nd */ priva boolan isComplmnEnd() { (!procssInsanc.isComplmnDaa()) { rurn ru; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
ry { Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam()); Da ndTim = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE)); rurn procssInsanc.gSchdulTim().quals(ndTim); } cach (Excpion ) { loggr.rror("complmn nd faild ", ); rurn fals; } } /** * updaProcssInsanc procss insanc sa * afr ach bach of asks is xcud, h saus of h procss insanc is updad */ priva void updaProcssInsancSa() { ExcuionSaus sa = gProcssInsancSa(); (procssInsanc.gSa() != sa) { loggr.info( "work flow procss insanc [id: {}, nam:{}], sa chang from {} o {}, cmd yp: {}", procssInsanc.gId(), procssInsanc.gNam(), procssInsanc.gSa(), sa, procssInsanc.gCommandTyp()); ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId()); insanc.sSa(sa); insanc.sProcssDfiniion(procssInsanc.gProcssDfiniion()); procssSrvic.updaProcssInsanc(insanc); procssInsanc = insanc; } } /** * g ask dpndncy rsul
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* * @param askInsanc ask insanc * @rurn DpndRsul */ priva DpndRsul gDpndRsulForTask(TaskInsanc askInsanc) { rurn isTaskDpsCompl(askInsanc.gNam()); } /** * add ask o sandby lis * * @param askInsanc ask insanc */ priva void addTaskToSandByLis(TaskInsanc askInsanc) { loggr.info("add ask o sand by lis: {}", askInsanc.gNam()); ry { radyToSubmiTaskQuu.pu(askInsanc); } cach (Excpion ) { loggr.rror("add ask insanc o radyToSubmiTaskQuu rror, askNam: {}", askInsanc.gNam(), ); } } /** * rmov ask from sand by lis * * @param askInsanc ask insanc */ priva void rmovTaskFromSandbyLis(TaskInsanc askInsanc) { loggr.info("rmov ask from sand by lis: {}", askInsanc.gNam()); ry { radyToSubmiTaskQuu.rmov(askInsanc); } cach (Excpion ) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
loggr.rror("rmov ask insanc from radyToSubmiTaskQuu rror, askNam: {}", askInsanc.gNam(), ); } } /** * has rry ask in sandby * * @rurn Boolan whhr has rry ask in sandby */ priva boolan hasRryTaskInSandBy() { for (Iraor<TaskInsanc> ir = radyToSubmiTaskQuu.iraor(); ir.hasNx(); ) { (ir.nx().gSa().ypIsFailur()) { rurn ru; } } rurn fals; } /** * submi and wach h asks, unil h work flow sop */ priva void runProcss() { // submi sar nod submiPosNod(null); boolan sndTimWarning = fals; whil (!procssInsanc.isProcssInsancSop() && Soppr.isRunning()) { // snd warn (!sndTimWarning && chckProcssTimOu(procssInsanc)) { alrManagr.sndProcssTimouAlr(procssInsanc, procssSrvic.findProcssDfinById(procssInsanc.gProcssDfiniionId())); sndTimWarning = ru; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
for (Map.Enry<MasrBasTaskExcThrad, Fuur<Boolan>> nry : acivTaskNod.nryS()) { Fuur<Boolan> fuur = nry.gValu(); TaskInsanc ask = nry.gKy().gTaskInsanc(); (!fuur.isDon()) { coninu; } // nod moni ask = his.procssSrvic.findTaskInsancById(ask.gId()); (ask == null) { his.askFaildSubmi = ru; acivTaskNod.rmov(nry.gKy()); coninu; } // nod moni (ask.gSa().ypIsFinishd()) { acivTaskNod.rmov(nry.gKy()); } loggr.info("ask :{}, id:{} compl, sa is {} ", ask.gNam(), ask.gId(), ask.gSa()); // nod succ (ask.gSa() == ExcuionSaus.SUCCESS) { procssInsanc = procssSrvic.findProcssInsancById(procssInsanc.gId()); procssInsanc.sVarPool(ask.gVarPool()); procssSrvic.updaProcssInsanc(procssInsanc); complTaskLis.pu(ask.gNam(), ask); submiPosNod(ask.gNam()); coninu; } // nod fail (ask.gSa().ypIsFailur()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
(ask.gSa() == ExcuionSaus.NEED_FAULT_TOLERANCE) { his.rcovrTolrancFaulTaskLis.add(ask); } (ask.askCanRry()) { addTaskToSandByLis(ask); } ls { complTaskLis.pu(ask.gNam(), ask); (ask.isCondiionsTask() || DagHlpr.havCondiionsAfrNod(ask.gNam(), dag)) { submiPosNod(ask.gNam()); } ls { rrorTaskLis.pu(ask.gNam(), ask); (procssInsanc.gFailurSragy() == FailurSragy.END) { killThOhrTasks(); } } } coninu; } // ohr sa complTaskLis.pu(ask.gNam(), ask); } // snd alr (CollcionUils.isNoEmpy(his.rcovrTolrancFaulTaskLis)) { alrManagr.sndAlrWorkrTolrancFaul(procssInsanc, rcovrTolrancFaulTaskLis); his.rcovrTolrancFaulTaskLis.clar(); } // updaPro // failur p // a ask
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
// chck (rrorTaskLis.siz() > 0) { for (Map.Enry<Sring, TaskInsanc> nry : complTaskLis.nryS()) { TaskInsanc complTask = nry.gValu(); (complTask.gSa() == ExcuionSaus.PAUSE) { complTask.sSa(ExcuionSaus.KILL); complTaskLis.pu(nry.gKy(), complTask); procssSrvic.updaTaskInsanc(complTask); } } for (Map.Enry<Sring, TaskInsanc> nry : rrorTaskLis.nryS()) { TaskInsanc rrorTask = nry.gValu(); TaskInsanc currnTask = procssSrvic.findTaskInsancById(rrorTask.gId()); (currnTask == null) { coninu; } // for nods (rrorTask.gSa().ypIsFailur() && currnTask.gSa().quals(ExcuionSaus.FORCED_SUCCESS)) { // upda s rrorTask.sSa(currnTask.gSa()); loggr.info("ask: {} has bn forcd succss, rmov i from rror ask lis", rrorTask.gNam()); rrorTaskLis.rmov(rrorTask.gNam()); // submi po submiPosNod(rrorTask.gNam()); } } } (canSubmiTaskToQuu()) { submiSandByTask(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
ry { Thrad.slp(Consans.SLEEP_TIME_MILLIS); } cach (InrrupdExcpion ) { loggr.rror(.gMssag(), ); Thrad.currnThrad().inrrup(); } updaProcssInsancSa(); } loggr.info("procss:{} nd, sa :{}", procssInsanc.gId(), procssInsanc.gSa()); } /** * whhr chck procss im ou * * @param procssInsanc ask insanc * @rurn ru im ou of procss insanc > running im of procss insanc */ priva boolan chckProcssTimOu(ProcssInsanc procssInsanc) { (procssInsanc.gTimou() == 0) { rurn fals; } Da now = nw Da(); long runningTim = DaUils.dfMin(now, procssInsanc.gSarTim()); rurn runningTim > procssInsanc.gTimou(); } /** * whhr can submi ask o quu * * @rurn boolan */ priva boolan canSubmiTaskToQuu() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
rurn OSUils.chckRsourc(masrConfig.gMasrMaxCpuloadAvg(), masrConfig.gMasrRsrvdMmory()); } /** * clos h on going asks */ priva void killThOhrTasks() { loggr.info("kill calld on : {}, num: {}", procssInsanc.gId(), acivTaskNod.siz()); for (Map.Enry<MasrBasTaskExcThrad, Fuur<Boolan>> nry : acivTaskNod.nryS()) { MasrBasTaskExcThrad askExcThrad = nry.gKy(); Fuur<Boolan> fuur = nry.gValu(); TaskInsanc askInsanc = askExcThrad.gTaskInsanc(); askInsanc = procssSrvic.findTaskInsancById(askInsanc.gId()); (askInsanc != null && askInsanc.gSa().ypIsFinishd()) { coninu; } (!fuur.isDon()) { // rcord ki loggr.info("kill procss insanc, id: {}, ask: {}", procssInsanc.gId(), askExcThrad.gTaskInsanc().gId()); // kill nod askExcThrad.kill(); } } } /** * whhr h rry inrval is imd ou * * @param askInsanc ask insanc * @rurn Boolan */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
priva boolan rryTaskInrvalOvrTim(TaskInsanc askInsanc) { (askInsanc.gSa() != ExcuionSaus.FAILURE) { rurn ru; } (askInsanc.gId() == 0 || askInsanc.gMaxRryTims() == 0 || askInsanc.gRryInrval() == 0) { rurn ru; } Da now = nw Da(); long faildTimInrval = DaUils.dfrSc(now, askInsanc.gEndTim()); // ask rry dos no ovr im, rurn fals rurn askInsanc.gRryInrval() * SEC_2_MINUTES_TIME_UNIT < faildTimInrval; } /** * handling h lis of asks o b submid */ priva void submiSandByTask() { ry { in lngh = radyToSubmiTaskQuu.siz(); for (in i = 0; i < lngh; i++) { TaskInsanc ask = radyToSubmiTaskQuu.pk(); // sop ask (ask.askCanRry()) { TaskInsanc rryTask = procssSrvic.findTaskInsancById(ask.gId()); (rryTask != null && rryTask.gSa().quals(ExcuionSaus.FORCED_SUCCESS)) { ask.sSa(rryTask.gSa()); loggr.info("ask: {} has bn forcd succss, pu i ino compl ask lis and sop rrying", ask.gNam());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
rmovTaskFromSandbyLis(ask); complTaskLis.pu(ask.gNam(), ask); submiPosNod(ask.gNam()); coninu; } } DpndRsul dpndRsul = gDpndRsulForTask(ask); (DpndRsul.SUCCESS == dpndRsul) { (rryTaskInrvalOvrTim(ask)) { submiTaskExc(ask); rmovTaskFromSandbyLis(ask); } } ls (DpndRsul.FAILED == dpndRsul) { // h d dpndFaildTask.pu(ask.gNam(), ask); rmovTaskFromSandbyLis(ask); loggr.info("ask {},id:{} dpnd rsul : {}", ask.gNam(), ask.gId(), dpndRsul); } ls (DpndRsul.NON_EXEC == dpndRsul) { // for som rmovTaskFromSandbyLis(ask); loggr.info("rmov ask {},id:{} , bcaus dpnd rsul : {}", ask.gNam(), ask.gId(), dpndRsul); } } } cach (Excpion ) { loggr.rror("submi sandby ask rror", ); } } /** * g rcovry ask insanc *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* @param askId ask id * @rurn rcovry ask insanc */ priva TaskInsanc gRcovryTaskInsanc(Sring askId) { (!SringUils.isNoEmpy(askId)) { rurn null; } ry { Ingr inId = Ingr.valuOf(askId); TaskInsanc ask = procssSrvic.findTaskInsancById(inId); (ask == null) { loggr.rror("sar nod id canno b found: {}", askId); } ls { rurn ask; } } cach (Excpion ) { loggr.rror("g rcovry ask insanc faild ", ); } rurn null; } /** * g sar ask insanc lis * * @param cmdParam command param * @rurn ask insanc lis */ priva Lis<TaskInsanc> gSarTaskInsancLis(Sring cmdParam) { Lis<TaskInsanc> insancLis = nw ArrayLis<>(); Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam); (paramMap != null && paramMap.conainsKy(CMD_PARAM_RECOVERY_START_NODE_STRING)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
Sring[] idLis = paramMap.g(CMD_PARAM_RECOVERY_START_NODE_STRING).spli(Consans.COMMA); for (Sring nodId : idLis) { TaskInsanc ask = gRcovryTaskInsanc(nodId); (ask != null) { insancLis.add(ask); } } } rurn insancLis; } /** * pars "SarNodNamLis" from cmd param * * @param cmdParam command param * @rurn sar nod nam lis */ priva Lis<Sring> parsSarNodNam(Sring cmdParam) { Lis<Sring> sarNodNamLis = nw ArrayLis<>(); Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam); (paramMap == null) { rurn sarNodNamLis; } (paramMap.conainsKy(CMD_PARAM_START_NODE_NAMES)) { sarNodNamLis = Arrays.asLis(paramMap.g(CMD_PARAM_START_NODE_NAMES).spli(Consans.COMMA)); } rurn sarNodNamLis; } /** * gnra sar nod nam lis from parsing command param; * "SarNodIdLis" xiss in command param, rurn SarNodIdLis
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java
* * @rurn rcovry nod nam lis */ priva Lis<Sring> gRcovryNodNamLis() { Lis<Sring> rcovryNodNamLis = nw ArrayLis<>(); (CollcionUils.isNoEmpy(rcovrNodIdLis)) { for (TaskInsanc ask : rcovrNodIdLis) { rcovryNodNamLis.add(ask.gNam()); } } rurn rcovryNodNamLis; } /** * gnra flow dag * * @param procssDfiniionJson procss dfiniion json * @param sarNodNamLis sar nod nam lis * @param rcovryNodNamLis rcovry nod nam lis * @param dpNodTyp dpnd nod yp * @rurn ProcssDag procss dag * @hrows Excpion xcpion */ public ProcssDag gnraFlowDag(Sring procssDfiniionJson, Lis<Sring> sarNodNamLis, Lis<Sring> rcovryNodNamLis, TaskDpndTyp dpNodTyp) hrows Excpion { rurn DagHlpr.gnraFlowDag(procssDfiniionJson, sarNodNamLis, rcovryNodNamLis, dpNodTyp); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
* limitations under the License. */ package org.apache.dolphinscheduler.server.master.runner; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.remote.NettyRemotingClient; import org.apache.dolphinscheduler.remote.config.NettyClientConfig; import org.apache.dolphinscheduler.server.master.config.MasterConfig; import org.apache.dolphinscheduler.server.master.zk.ZKMasterClient; import org.apache.dolphinscheduler.server.utils.AlertManager; import org.apache.dolphinscheduler.service.process.ProcessService; import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.recipes.locks.InterProcessMutex; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * master scheduler thread */ @Service public class MasterSchedulerService extends Thread {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
/** * logger of MasterSchedulerService */ private static final Logger logger = LoggerFactory.getLogger(MasterSchedulerService.class); /** * dolphinscheduler database interface */ @Autowired private ProcessService processService; /** * zookeeper master client */ @Autowired private ZKMasterClient zkMasterClient; /** * master config */ @Autowired private MasterConfig masterConfig; /** * alert manager */ private AlertManager alertManager = new AlertManager(); /** * netty remoting client */ private NettyRemotingClient nettyRemotingClient; /** * master exec service */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
private ThreadPoolExecutor masterExecService; /** * constructor of MasterSchedulerService */ @PostConstruct public void init() { this.masterExecService = (ThreadPoolExecutor)ThreadUtils.newDaemonFixedThreadExecutor("Master-Exec-Thread", masterConfig.getMasterExecThreads()); NettyClientConfig clientConfig = new NettyClientConfig(); this.nettyRemotingClient = new NettyRemotingClient(clientConfig); } @Override public synchronized void start() { super.setName("MasterSchedulerService"); super.start(); } public void close() { masterExecService.shutdown(); boolean terminated = false; try { terminated = masterExecService.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } if (!terminated) { logger.warn("masterExecService shutdown without terminated, increase await time"); } nettyRemotingClient.close(); logger.info("master schedule service stopped..."); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
* run of MasterSchedulerService */ @Override public void run() { logger.info("master scheduler started"); while (Stopper.isRunning()) { try { boolean runCheckFlag = OSUtils.checkResource(masterConfig.getMasterMaxCpuloadAvg(), masterConfig.getMasterReservedMemory()); if (!runCheckFlag) { Thread.sleep(Constants.SLEEP_TIME_MILLIS); continue; } if (zkMasterClient.getZkClient().getState() == CuratorFrameworkState.STARTED) { scheduleProcess(); } } catch (Exception e) { logger.error("master scheduler thread error", e); } } } private void scheduleProcess() throws Exception { InterProcessMutex mutex = null; try { mutex = zkMasterClient.blockAcquireMutex(); int activeCount = masterExecService.getActiveCount(); Command command = processService.findOneCommand(); if (command != null) { logger.info("find one command: id: {}, type: {}", command.getId(),command.getCommandType()); try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
ProcessInstance processInstance = processService.handleCommand(logger, getLocalAddress(), this.masterConfig.getMasterExecThreads() - activeCount, command); if (processInstance != null) { logger.info("start master exec thread , split DAG ..."); masterExecService.execute( new MasterExecThread( processInstance , processService , nettyRemotingClient , alertManager , masterConfig)); } } catch (Exception e) { logger.error("scan command error ", e); processService.moveToErrorCommand(command, e.toString()); } } else { Thread.sleep(Constants.SLEEP_TIME_MILLIS); } } finally { zkMasterClient.releaseMutex(mutex); } } private String getLocalAddress() { return NetUtils.getAddr(masterConfig.getListenPort()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.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
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
*/ package org.apache.dolphinscheduler.server.utils; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.DependResult; import org.apache.dolphinscheduler.common.enums.DependentRelation; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.DependentItem; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.DependentUtils; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.utils.DagHelper; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.process.ProcessService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; /** * dependent item execute */ public class DependentExecute { /** * process service */ private final ProcessService processService = SpringApplicationContext.getBean(ProcessService.class); /** * depend item list */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
private List<DependentItem> dependItemList; /** * dependent relation */ private DependentRelation relation; /** * depend result */ private DependResult modelDependResult = DependResult.WAITING; /** * depend result map */ private Map<String, DependResult> dependResultMap = new HashMap<>(); /** * logger */ private Logger logger = LoggerFactory.getLogger(DependentExecute.class); /** * constructor * @param itemList item list * @param relation relation */ public DependentExecute(List<DependentItem> itemList, DependentRelation relation){ this.dependItemList = itemList; this.relation = relation; } /** * get dependent item for one dependent item * @param dependentItem dependent item * @param currentTime current time
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
* @return DependResult */ private DependResult getDependentResultForItem(DependentItem dependentItem, Date currentTime){ List<DateInterval> dateIntervals = DependentUtils.getDateIntervalList(currentTime, dependentItem.getDateValue()); return calculateResultForTasks(dependentItem, dateIntervals ); } /** * calculate dependent result for one dependent item. * @param dependentItem dependent item * @param dateIntervals date intervals * @return dateIntervals */ private DependResult calculateResultForTasks(DependentItem dependentItem, List<DateInterval> dateIntervals) { DependResult result = DependResult.FAILED; for(DateInterval dateInterval : dateIntervals){ ProcessInstance processInstance = findLastProcessInterval(dependentItem.getDefinitionId(), dateInterval); if(processInstance == null){ return DependResult.WAITING; } if(dependentItem.getDepTasks().equals(Constants.DEPENDENT_ALL)){ result = dependResultByProcessInstance(processInstance); }else{ result = getDependTaskResult(dependentItem.getDepTasks(),processInstance); } if(result != DependResult.SUCCESS){ break; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
} return result; } /** * depend type = depend_all * @return */ private DependResult dependResultByProcessInstance(ProcessInstance processInstance){ if(!processInstance.getState().typeIsFinished()){ return DependResult.WAITING; } if(processInstance.getState().typeIsSuccess()){ return DependResult.SUCCESS; } return DependResult.FAILED; } /** * get depend task result * @param taskName * @param processInstance * @return */ private DependResult getDependTaskResult(String taskName, ProcessInstance processInstance) { DependResult result; TaskInstance taskInstance = null; List<TaskInstance> taskInstanceList = processService.findValidTaskListByProcessId(processInstance.getId()); for(TaskInstance task : taskInstanceList){ if(task.getName().equals(taskName)){ taskInstance = task; break;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
} } if(taskInstance == null){ if(processInstance.getState().typeIsFinished()){ result = DependResult.FAILED; }else{ return DependResult.WAITING; } }else{ result = getDependResultByState(taskInstance.getState()); } return result; } /** * find the last one process instance that : * 1. manual run and finish between the interval * 2. schedule run and schedule time between the interval * @param definitionId definition id * @param dateInterval date interval * @return ProcessInstance */ private ProcessInstance findLastProcessInterval(int definitionId, DateInterval dateInterval) { ProcessInstance runningProcess = processService.findLastRunningProcess(definitionId, dateInterval.getStartTime(), dateInterval.getEndTime()); if(runningProcess != null){ return runningProcess; } ProcessInstance lastSchedulerProcess = processService.findLastSchedulerProcessInterval( definitionId, dateInterval
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
); ProcessInstance lastManualProcess = processService.findLastManualProcessInterval( definitionId, dateInterval ); if(lastManualProcess ==null){ return lastSchedulerProcess; } if(lastSchedulerProcess == null){ return lastManualProcess; } return (lastManualProcess.getEndTime().after(lastSchedulerProcess.getEndTime()))? lastManualProcess : lastSchedulerProcess; } /** * get dependent result by task/process instance state * @param state state * @return DependResult */ private DependResult getDependResultByState(ExecutionStatus state) { if(!state.typeIsFinished()){ return DependResult.WAITING; }else if(state.typeIsSuccess()){ return DependResult.SUCCESS; }else{ return DependResult.FAILED; } } /** * get dependent result by task instance state when task instance is null * @param state state
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
* @return DependResult */ private DependResult getDependResultByProcessStateWhenTaskNull(ExecutionStatus state) { if(state.typeIsRunning() || state == ExecutionStatus.SUBMITTED_SUCCESS || state == ExecutionStatus.WAITTING_THREAD){ return DependResult.WAITING; }else{ return DependResult.FAILED; } } /** * judge depend item finished * @param currentTime current time * @return boolean */ public boolean finish(Date currentTime){ if(modelDependResult == DependResult.WAITING){ modelDependResult = getModelDependResult(currentTime); return false; } return true; } /** * get model depend result * @param currentTime current time * @return DependResult */ public DependResult getModelDependResult(Date currentTime){ List<DependResult> dependResultList = new ArrayList<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/DependentExecute.java
for(DependentItem dependentItem : dependItemList){ DependResult dependResult = getDependResultForItem(dependentItem, currentTime); if(dependResult != DependResult.WAITING){ dependResultMap.put(dependentItem.getKey(), dependResult); } dependResultList.add(dependResult); } modelDependResult = DependentUtils.getDependResultForRelation( this.relation, dependResultList ); return modelDependResult; } /** * get dependent item result * @param item item * @param currentTime current time * @return DependResult */ private DependResult getDependResultForItem(DependentItem item, Date currentTime){ String key = item.getKey(); if(dependResultMap.containsKey(key)){ return dependResultMap.get(key); } return getDependentResultForItem(item, currentTime); } public Map<String, DependResult> getDependResultMap(){ return dependResultMap; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.utils; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.DataType; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.common.utils.placeholder.BusinessTimeUtils; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java
/** * param utils */ public class ParamUtils { /** * parameter conversion * @param globalParams global params * @param globalParamsMap global params map * @param localParams local params * @param commandType command type * @param scheduleTime schedule time * @return global params */ public static Map<String,Property> convert(Map<String,Property> globalParams, Map<String,String> globalParamsMap, Map<String,Property> localParams, CommandType commandType, Date scheduleTime){ if (globalParams == null && localParams == null){ return null; } Map<String,String> timeParams = BusinessTimeUtils .getBusinessTime(commandType, scheduleTime); if (globalParamsMap != null){ timeParams.putAll(globalParamsMap);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java
} if (globalParams != null && localParams != null){ globalParams.putAll(localParams); }else if (globalParams == null && localParams != null){ globalParams = localParams; } Iterator<Map.Entry<String, Property>> iter = globalParams.entrySet().iterator(); while (iter.hasNext()){ Map.Entry<String, Property> en = iter.next(); Property property = en.getValue(); if (StringUtils.isNotEmpty(property.getValue()) && property.getValue().startsWith("$")){ /** * local parameter refers to global parameter with the same name * note: the global parameters of the process instance here are solidified parameters, * and there are no variables in them. */ String val = property.getValue(); val = ParameterUtils.convertParameterPlaceholders(val, timeParams); property.setValue(val); } } return globalParams; } /** * format convert * @param paramsMap params map * @return Map of converted */ public static Map<String,String> convert(Map<String,Property> paramsMap){
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ParamUtils.java
if(paramsMap == null){ return null; } Map<String,String> map = new HashMap<>(); Iterator<Map.Entry<String, Property>> iter = paramsMap.entrySet().iterator(); while (iter.hasNext()){ Map.Entry<String, Property> en = iter.next(); map.put(en.getKey(),en.getValue().getValue()); } return map; } /** * get parameters map * @param definedParams definedParams * @return parameters map */ public static Map<String,Property> getUserDefParamsMap(Map<String,String> definedParams) { if (definedParams != null) { Map<String,Property> userDefParamsMaps = new HashMap<>(); Iterator<Map.Entry<String, String>> iter = definedParams.entrySet().iterator(); while (iter.hasNext()){ Map.Entry<String, String> en = iter.next(); Property property = new Property(en.getKey(), Direct.IN, DataType.VARCHAR , en.getValue()); userDefParamsMaps.put(property.getProp(),property); } return userDefParamsMaps; } return null; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/AlertManagerTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.server.master; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProjectUser; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.server.utils.AlertManager; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/AlertManagerTest.java
import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; import java.util.List; /** * alert manager test */ @Ignore public class AlertManagerTest { private static final Logger logger = LoggerFactory.getLogger(AlertManagerTest.class); @Autowired ProcessDefinitionMapper processDefinitionMapper; @Autowired ProcessInstanceMapper processInstanceMapper; @Autowired TaskInstanceMapper taskInstanceMapper; @Autowired ProjectMapper projectMapper; AlertManager alertManager; /** * send worker alert fault tolerance */ @Test public void sendWarnningWorkerleranceFaultTest(){ ProcessInstance processInstance = processInstanceMapper.queryDetailById(13028); ProcessDefinition processDefinition = processDefinitionMapper.selectById(47); processInstance.setProcessDefinition(processDefinition);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,058
[Improvement][Master] The master-server creates the DB data source twice
**Describe the question** The master-server creates the DB data source twice 1. Load the data source through Spring 2.AlertManager builds the data source with the ConnectionFactory factory class **Which version of DolphinScheduler:** -[dev] ![image](https://user-images.githubusercontent.com/37063904/112297565-03847d00-8cd1-11eb-878b-75e12060172a.png)
https://github.com/apache/dolphinscheduler/issues/5058
https://github.com/apache/dolphinscheduler/pull/5139
0d8011f9c1daa2b79dd45b0c80731d6b31ab0f07
9c77faa8ace7242ab9d37b9c6e65a699f1e2f829
"2021-03-15T12:24:11Z"
java
"2021-05-10T01:56:17Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/AlertManagerTest.java
TaskInstance toleranceTask1 = taskInstanceMapper.selectById(5038); TaskInstance toleranceTask2 = taskInstanceMapper.selectById(5039); List<TaskInstance> toleranceTaskList = new ArrayList<>(2); toleranceTaskList.add(toleranceTask1); toleranceTaskList.add(toleranceTask2); alertManager.sendAlertWorkerToleranceFault(processInstance, toleranceTaskList); } /** * send worker alert fault tolerance */ @Test public void sendWarnningOfProcessInstanceTest(){ ProcessInstance processInstance = processInstanceMapper.queryDetailById(13028); ProcessDefinition processDefinition = processDefinitionMapper.selectById(47); processInstance.setProcessDefinition(processDefinition); TaskInstance toleranceTask1 = taskInstanceMapper.selectById(5038); toleranceTask1.setState(ExecutionStatus.FAILURE); TaskInstance toleranceTask2 = taskInstanceMapper.selectById(5039); toleranceTask2.setState(ExecutionStatus.FAILURE); List<TaskInstance> toleranceTaskList = new ArrayList<>(2); toleranceTaskList.add(toleranceTask1); toleranceTaskList.add(toleranceTask2); ProjectUser projectUser = projectMapper.queryProjectWithUserByProcessInstanceId(processInstance.getId()); alertManager.sendAlertProcessInstance(processInstance, toleranceTaskList, projectUser); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,424
[Feature][Plugin-Email] Numeric data type support in email attachment
Status Quo Dolphinscheduler currently supports executing SQL and send result as email table/attachment, however the .xls attachment is forcing all columns to be "text" type and creates difficulty in data manipulation down the line (not sure this is a bug or expected behavior). Suggestion Hoping to see support for automatic data type in .xls, and/or additional support for other attachment format such as csv, txt or xlsx
https://github.com/apache/dolphinscheduler/issues/5424
https://github.com/apache/dolphinscheduler/pull/5426
fbef290cc5e611bfee7a430472b2b2774dd6d921
5556e47a85b40b28688cd41e27a96f4b1bc4e225
"2021-05-06T13:13:24Z"
java
"2021-05-11T12:53:27Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dolphinscheduler.plugin.alert.email; import org.apache.dolphinscheduler.plugin.alert.email.exception.AlertEmailException; import org.apache.dolphinscheduler.spi.utils.JSONUtils;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,424
[Feature][Plugin-Email] Numeric data type support in email attachment
Status Quo Dolphinscheduler currently supports executing SQL and send result as email table/attachment, however the .xls attachment is forcing all columns to be "text" type and creates difficulty in data manipulation down the line (not sure this is a bug or expected behavior). Suggestion Hoping to see support for automatic data type in .xls, and/or additional support for other attachment format such as csv, txt or xlsx
https://github.com/apache/dolphinscheduler/issues/5424
https://github.com/apache/dolphinscheduler/pull/5426
fbef290cc5e611bfee7a430472b2b2774dd6d921
5556e47a85b40b28688cd41e27a96f4b1bc4e225
"2021-05-06T13:13:24Z"
java
"2021-05-11T12:53:27Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java
import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * excel utils */ public class ExcelUtils { private ExcelUtils() { throw new IllegalStateException("Utility class"); } private static final Logger logger = LoggerFactory.getLogger(ExcelUtils.class); private static final int XLSX_WINDOW_ROW = 10000; /** * generate excel file * * @param content the content * @param title the title * @param xlsFilePath the xls path
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,424
[Feature][Plugin-Email] Numeric data type support in email attachment
Status Quo Dolphinscheduler currently supports executing SQL and send result as email table/attachment, however the .xls attachment is forcing all columns to be "text" type and creates difficulty in data manipulation down the line (not sure this is a bug or expected behavior). Suggestion Hoping to see support for automatic data type in .xls, and/or additional support for other attachment format such as csv, txt or xlsx
https://github.com/apache/dolphinscheduler/issues/5424
https://github.com/apache/dolphinscheduler/pull/5426
fbef290cc5e611bfee7a430472b2b2774dd6d921
5556e47a85b40b28688cd41e27a96f4b1bc4e225
"2021-05-06T13:13:24Z"
java
"2021-05-11T12:53:27Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java
*/ public static void genExcelFile(String content, String title, String xlsFilePath) { File file = new File(xlsFilePath); if (!file.exists() && !file.mkdirs()) { logger.error("Create xlsx directory error, path:{}", xlsFilePath); throw new AlertEmailException("Create xlsx directory error"); } List<LinkedHashMap> itemsList = JSONUtils.toList(content, LinkedHashMap.class); if (CollectionUtils.isEmpty(itemsList)) { logger.error("itemsList is null"); throw new AlertEmailException("itemsList is null"); } LinkedHashMap<String, Object> headerMap = itemsList.get(0); List<String> headerList = new ArrayList<>(); for (Map.Entry<String, Object> en : headerMap.entrySet()) { headerList.add(en.getKey()); } try (SXSSFWorkbook wb = new SXSSFWorkbook(XLSX_WINDOW_ROW); FileOutputStream fos = new FileOutputStream(String.format("%s/%s.xlsx", xlsFilePath, title))) { Sheet sheet = wb.createSheet(); Row row = sheet.createRow(0); row.setHeight((short) 500); CellStyle cellStyle = wb.createCellStyle(); cellStyle.setAlignment(HorizontalAlignment.RIGHT); for (int i = 0; i < headerList.size(); i++) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,424
[Feature][Plugin-Email] Numeric data type support in email attachment
Status Quo Dolphinscheduler currently supports executing SQL and send result as email table/attachment, however the .xls attachment is forcing all columns to be "text" type and creates difficulty in data manipulation down the line (not sure this is a bug or expected behavior). Suggestion Hoping to see support for automatic data type in .xls, and/or additional support for other attachment format such as csv, txt or xlsx
https://github.com/apache/dolphinscheduler/issues/5424
https://github.com/apache/dolphinscheduler/pull/5426
fbef290cc5e611bfee7a430472b2b2774dd6d921
5556e47a85b40b28688cd41e27a96f4b1bc4e225
"2021-05-06T13:13:24Z"
java
"2021-05-11T12:53:27Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java
Cell cell = row.createCell(i); cell.setCellStyle(cellStyle); cell.setCellValue(headerList.get(i)); } int rowIndex = 1; for (LinkedHashMap<String, Object> itemsMap : itemsList) { Object[] values = itemsMap.values().toArray(); row = sheet.createRow(rowIndex); row.setHeight((short) 500); rowIndex++; for (int j = 0; j < values.length; j++) { Cell cell1 = row.createCell(j); cell1.setCellStyle(cellStyle); cell1.setCellValue(String.valueOf(values[j])); } } for (int i = 0; i < headerList.size(); i++) { sheet.setColumnWidth(i, headerList.get(i).length() * 800); } wb.write(fos); wb.dispose(); } catch (Exception e) { throw new AlertEmailException("generate excel error", e); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,475
[Improvement][Api] Upload resource to remote failed, the local tmp file need to be cleared
**Describe the question** When we upload a resource file, ds will do three thing. 1. create a local tmp file 2. cope the local tmp file to remote and delete the local file https://github.com/apache/dolphinscheduler/blob/d04f4b60535cd86905e56b0a732f2ec038680eb7/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java#L595-L605 But when the second step is failed, the local tmp file will not be cleaned, **Which version of DolphinScheduler:** -[1.3.6] -[dev] **Describe alternatives you've considered** When upload to remote throw an exception, clean local tmp file
https://github.com/apache/dolphinscheduler/issues/5475
https://github.com/apache/dolphinscheduler/pull/5476
d04f4b60535cd86905e56b0a732f2ec038680eb7
68301db6b914ff4002bfbc531c6810864d8e47c2
"2021-05-15T03:21:13Z"
java
"2021-05-17T03:13:14Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.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 static org.apache.dolphinscheduler.common.Constants.ALIAS; import static org.apache.dolphinscheduler.common.Constants.CONTENT; import static org.apache.dolphinscheduler.common.Constants.JAR;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,475
[Improvement][Api] Upload resource to remote failed, the local tmp file need to be cleared
**Describe the question** When we upload a resource file, ds will do three thing. 1. create a local tmp file 2. cope the local tmp file to remote and delete the local file https://github.com/apache/dolphinscheduler/blob/d04f4b60535cd86905e56b0a732f2ec038680eb7/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java#L595-L605 But when the second step is failed, the local tmp file will not be cleaned, **Which version of DolphinScheduler:** -[1.3.6] -[dev] **Describe alternatives you've considered** When upload to remote throw an exception, clean local tmp file
https://github.com/apache/dolphinscheduler/issues/5475
https://github.com/apache/dolphinscheduler/pull/5476
d04f4b60535cd86905e56b0a732f2ec038680eb7
68301db6b914ff4002bfbc531c6810864d8e47c2
"2021-05-15T03:21:13Z"
java
"2021-05-17T03:13:14Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
import org.apache.dolphinscheduler.api.dto.resources.ResourceComponent; import org.apache.dolphinscheduler.api.dto.resources.filter.ResourceFilter; import org.apache.dolphinscheduler.api.dto.resources.visitor.ResourceTreeVisitor; import org.apache.dolphinscheduler.api.dto.resources.visitor.Visitor; import org.apache.dolphinscheduler.api.enums.Status; import org.apache.dolphinscheduler.api.exceptions.ServiceException; import org.apache.dolphinscheduler.api.service.ResourcesService; import org.apache.dolphinscheduler.api.utils.PageInfo; import org.apache.dolphinscheduler.api.utils.RegexUtils; import org.apache.dolphinscheduler.api.utils.Result; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.utils.BooleanUtils; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import org.apache.dolphinscheduler.common.utils.FileUtils; import org.apache.dolphinscheduler.common.utils.HadoopUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.PropertyUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; 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.UdfFunc; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; 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.UdfFuncMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,475
[Improvement][Api] Upload resource to remote failed, the local tmp file need to be cleared
**Describe the question** When we upload a resource file, ds will do three thing. 1. create a local tmp file 2. cope the local tmp file to remote and delete the local file https://github.com/apache/dolphinscheduler/blob/d04f4b60535cd86905e56b0a732f2ec038680eb7/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java#L595-L605 But when the second step is failed, the local tmp file will not be cleaned, **Which version of DolphinScheduler:** -[1.3.6] -[dev] **Describe alternatives you've considered** When upload to remote throw an exception, clean local tmp file
https://github.com/apache/dolphinscheduler/issues/5475
https://github.com/apache/dolphinscheduler/pull/5476
d04f4b60535cd86905e56b0a732f2ec038680eb7
68301db6b914ff4002bfbc531c6810864d8e47c2
"2021-05-15T03:21:13Z"
java
"2021-05-17T03:13:14Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.dao.utils.ResourceProcessDefinitionUtils; import org.apache.commons.beanutils.BeanMap; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; 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.UUID; import java.util.regex.Matcher; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fasterxml.jackson.databind.SerializationFeature; /** * resources service impl */ @Service
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,475
[Improvement][Api] Upload resource to remote failed, the local tmp file need to be cleared
**Describe the question** When we upload a resource file, ds will do three thing. 1. create a local tmp file 2. cope the local tmp file to remote and delete the local file https://github.com/apache/dolphinscheduler/blob/d04f4b60535cd86905e56b0a732f2ec038680eb7/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java#L595-L605 But when the second step is failed, the local tmp file will not be cleaned, **Which version of DolphinScheduler:** -[1.3.6] -[dev] **Describe alternatives you've considered** When upload to remote throw an exception, clean local tmp file
https://github.com/apache/dolphinscheduler/issues/5475
https://github.com/apache/dolphinscheduler/pull/5476
d04f4b60535cd86905e56b0a732f2ec038680eb7
68301db6b914ff4002bfbc531c6810864d8e47c2
"2021-05-15T03:21:13Z"
java
"2021-05-17T03:13:14Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesService { private static final Logger logger = LoggerFactory.getLogger(ResourcesServiceImpl.class); @Autowired private ResourceMapper resourcesMapper; @Autowired private UdfFuncMapper udfFunctionMapper; @Autowired private TenantMapper tenantMapper; @Autowired private UserMapper userMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ProcessDefinitionMapper processDefinitionMapper; /** * create directory * * @param loginUser login user * @param name alias * @param description description * @param type type * @param pid parent id * @param currentDir current directory * @return create directory result */ @Override @Transactional(rollbackFor = Exception.class) public Result<Object> createDirectory(User loginUser, String name, String description,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,475
[Improvement][Api] Upload resource to remote failed, the local tmp file need to be cleared
**Describe the question** When we upload a resource file, ds will do three thing. 1. create a local tmp file 2. cope the local tmp file to remote and delete the local file https://github.com/apache/dolphinscheduler/blob/d04f4b60535cd86905e56b0a732f2ec038680eb7/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java#L595-L605 But when the second step is failed, the local tmp file will not be cleaned, **Which version of DolphinScheduler:** -[1.3.6] -[dev] **Describe alternatives you've considered** When upload to remote throw an exception, clean local tmp file
https://github.com/apache/dolphinscheduler/issues/5475
https://github.com/apache/dolphinscheduler/pull/5476
d04f4b60535cd86905e56b0a732f2ec038680eb7
68301db6b914ff4002bfbc531c6810864d8e47c2
"2021-05-15T03:21:13Z"
java
"2021-05-17T03:13:14Z"
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
ResourceType type, int pid, String currentDir) { Result<Object> result = checkResourceUploadStartupState(); if (!result.getCode().equals(Status.SUCCESS.getCode())) { return result; } String fullName = currentDir.equals("/") ? String.format("%s%s",currentDir,name) : String.format("%s/%s",currentDir,name); result = verifyResource(loginUser, type, fullName, pid); if (!result.getCode().equals(Status.SUCCESS.getCode())) { return result; } if (checkResourceExists(fullName, 0, type.ordinal())) { logger.error("resource directory {} has exist, can't recreate", fullName); putMsg(result, Status.RESOURCE_EXIST); return result; } Date now = new Date(); Resource resource = new Resource(pid,name,fullName,true,description,name,loginUser.getId(),type,0,now,now); try { resourcesMapper.insert(resource); putMsg(result, Status.SUCCESS); Map<Object, Object> dataMap = new BeanMap(resource); Map<String, Object> resultMap = new HashMap<>(); for (Map.Entry<Object, Object> entry: dataMap.entrySet()) { if (!"class".equalsIgnoreCase(entry.getKey().toString())) { resultMap.put(entry.getKey().toString(), entry.getValue()); } } result.setData(resultMap);