[release] v3.4.8

This commit is contained in:
tjq 2021-03-07 23:37:05 +08:00
commit 6a25bb57e4
13 changed files with 44 additions and 29 deletions

View File

@ -10,13 +10,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-client</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>
<junit.version>5.6.1</junit.version>
<fastjson.version>1.2.68</fastjson.version>
<powerjob.common.version>3.4.7</powerjob.common.version>
<powerjob.common.version>3.4.8</powerjob.common.version>
<mvn.shade.plugin.version>3.2.4</mvn.shade.plugin.version>
</properties>

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-common</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>

View File

@ -16,6 +16,8 @@ public class PowerJobDKey {
*/
public static final String PREFERRED_NETWORK_INTERFACE = "powerjob.network.interface.preferred";
public static final String BIND_LOCAL_ADDRESS = "powerjob.network.local.address";
/**
* Java regular expressions for network interfaces that will be ignored.
*/

View File

@ -60,6 +60,12 @@ public class NetUtils {
return HOST_ADDRESS;
}
String addressFromJVM = System.getProperty(PowerJobDKey.BIND_LOCAL_ADDRESS);
if (StringUtils.isNotEmpty(addressFromJVM)) {
log.info("[Net] use address from[{}]: {}", PowerJobDKey.BIND_LOCAL_ADDRESS, addressFromJVM);
return HOST_ADDRESS = addressFromJVM;
}
InetAddress address = getLocalAddress();
if (address != null) {
return HOST_ADDRESS = address.getHostAddress();

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-official-processors</artifactId>
<version>1.0.1</version>
<version>1.0.3</version>
<packaging>jar</packaging>
<properties>
@ -102,6 +102,9 @@
<relocation>
<pattern>org</pattern>
<shadedPattern>shade.powerjob.org</shadedPattern>
<excludes>
<exclude>org.slf4j.*</exclude>
</excludes>
</relocation>
<relocation>
<pattern>com.google</pattern>

View File

@ -19,16 +19,16 @@ import tech.powerjob.official.processors.util.CommonUtils;
public abstract class CommonBasicProcessor implements BasicProcessor {
@Override
public ProcessResult process(TaskContext taskContext) throws Exception {
public ProcessResult process(TaskContext ctx) throws Exception {
String status = "unknown";
Stopwatch sw = Stopwatch.createStarted();
OmsLogger omsLogger = taskContext.getOmsLogger();
omsLogger.info("using params: {}", CommonUtils.parseParams(taskContext));
OmsLogger omsLogger = ctx.getOmsLogger();
omsLogger.info("using params: {}", CommonUtils.parseParams(ctx));
try {
ProcessResult result = process0(taskContext);
ProcessResult result = process0(ctx);
omsLogger.info("execute succeed, using {}, result: {}", sw, result);
status = result.isSuccess() ? "succeed" : "failed";
return result;
@ -37,7 +37,7 @@ public abstract class CommonBasicProcessor implements BasicProcessor {
omsLogger.error("execute failed!", t);
return new ProcessResult(false, ExceptionUtils.getMessage(t));
} finally {
log.info("status: {}, cost: {}", status, sw);
log.info("{}|{}|{}|{}|{}", getClass().getSimpleName(), ctx.getJobId(), ctx.getInstanceId(), status, sw);
}
}

View File

@ -47,18 +47,22 @@ public abstract class AbstractScriptProcessor extends CommonBasicProcessor {
StringBuilder inputSB = new StringBuilder();
StringBuilder errorSB = new StringBuilder();
pool.execute(() -> copyStream(process.getInputStream(), inputSB, omsLogger));
pool.execute(() -> copyStream(process.getErrorStream(), errorSB, omsLogger));
boolean success = true;
String result;
try {
boolean success = process.waitFor() == 0;
String result = String.format("[INPUT]: %s;[ERROR]: %s", inputSB.toString(), errorSB.toString());
try (InputStream is = process.getInputStream(); InputStream es = process.getErrorStream()) {
return new ProcessResult(success, result);
}catch (InterruptedException ie) {
pool.execute(() -> copyStream(is, inputSB, omsLogger));
pool.execute(() -> copyStream(es, errorSB, omsLogger));
success = process.waitFor() == 0;
} catch (InterruptedException ie) {
omsLogger.info("SYSTEM ===> ScriptProcessor has been interrupted");
return new ProcessResult(false, "Interrupted");
} finally {
result = String.format("[INPUT]: %s;[ERROR]: %s", inputSB.toString(), errorSB.toString());
}
return new ProcessResult(success, result);
}
private String prepareScriptFile(Long instanceId, String processorInfo) throws IOException {

View File

@ -10,13 +10,13 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-server</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>
<swagger.version>2.9.2</swagger.version>
<springboot.version>2.3.4.RELEASE</springboot.version>
<powerjob.common.version>3.4.7</powerjob.common.version>
<powerjob.common.version>3.4.8</powerjob.common.version>
<!-- MySQL version that corresponds to spring-boot-dependencies version. -->
<mysql.version>8.0.19</mysql.version>
<ojdbc.version>19.7.0.0</ojdbc.version>

View File

@ -3,7 +3,7 @@ logging.config=classpath:logback-dev.xml
####### Database properties(Configure according to the the environment) #######
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3307/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.core.username=root
spring.datasource.core.password=No1Bug2Please3!
spring.datasource.core.hikari.maximum-pool-size=20

View File

@ -10,18 +10,18 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-agent</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>
<powerjob.worker.version>3.4.7</powerjob.worker.version>
<powerjob.worker.version>3.4.8</powerjob.worker.version>
<logback.version>1.2.3</logback.version>
<picocli.version>4.3.2</picocli.version>
<spring.boot.version>2.2.6.RELEASE</spring.boot.version>
<powerjob.official.processors.version>1.0.1</powerjob.official.processors.version>
<powerjob.official.processors.version>1.0.3</powerjob.official.processors.version>
</properties>
<dependencies>

View File

@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-samples</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<properties>
<springboot.version>2.2.6.RELEASE</springboot.version>
<powerjob.worker.starter.version>3.4.7</powerjob.worker.starter.version>
<powerjob.worker.starter.version>3.4.8</powerjob.worker.starter.version>
<fastjson.version>1.2.68</fastjson.version>
<!-- 部署时跳过该module -->

View File

@ -10,11 +10,11 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker-spring-boot-starter</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>
<powerjob.worker.version>3.4.7</powerjob.worker.version>
<powerjob.worker.version>3.4.8</powerjob.worker.version>
<springboot.version>2.2.6.RELEASE</springboot.version>
</properties>

View File

@ -10,12 +10,12 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>powerjob-worker</artifactId>
<version>3.4.7</version>
<version>3.4.8</version>
<packaging>jar</packaging>
<properties>
<spring.version>5.2.4.RELEASE</spring.version>
<powerjob.common.version>3.4.7</powerjob.common.version>
<powerjob.common.version>3.4.8</powerjob.common.version>
<h2.db.version>1.4.200</h2.db.version>
<hikaricp.version>3.4.2</hikaricp.version>
<junit.version>5.6.1</junit.version>