You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "azexcy (via GitHub)" <gi...@apache.org> on 2023/12/04 11:32:16 UTC
[PR] Ignore interrupt exception at OpenGaussWALDumper [shardingsphere]
azexcy opened a new pull request, #29277:
URL: https://github.com/apache/shardingsphere/pull/29277
Changes proposed in this pull request:
- Ignore interrupt exception at OpenGaussWALDumper
- Remove stop_time when job start
---
Before committing this PR, I'm sure that I have checked the following options:
- [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [ ] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added corresponding unit tests for my changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Keep `stop_time` ,remove `stop_time_millis` at Pipeline job config properties [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz merged PR #29277:
URL: https://github.com/apache/shardingsphere/pull/29277
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Ignore interrupt exception at OpenGaussWALDumper [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on code in PR #29277:
URL: https://github.com/apache/shardingsphere/pull/29277#discussion_r1414969899
##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/common/ingest/channel/memory/SimpleMemoryPipelineChannel.java:
##########
@@ -60,7 +59,11 @@ public List<Record> fetchRecords(final int batchSize, final long timeout, final
do {
List<Record> records = queue.poll();
if (null == records || records.isEmpty()) {
- TimeUnit.MILLISECONDS.sleep(Math.min(100, timeoutMillis));
+ try {
+ TimeUnit.MILLISECONDS.sleep(Math.min(100, timeoutMillis));
+ } catch (final InterruptedException ignored) {
+ return Collections.emptyList();
+ }
Review Comment:
Similar issue as OpenGaussWALDumper, but it'll affect more types of job.
##########
kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/OpenGaussWALDumper.java:
##########
@@ -96,7 +94,11 @@ protected void runBlocking() {
int times = reconnectTimes.incrementAndGet();
log.error("Connect failed, reconnect times={}", times, ex);
if (isRunning()) {
- Thread.sleep(5000L);
+ try {
+ Thread.sleep(5000L);
+ } catch (final InterruptedException ignored) {
+ break;
+ }
Review Comment:
If InterruptedException is ignored, then CDCJob might consider this dumper running fine without error and trigger next step.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Ignore interrupt exception at OpenGaussWALDumper [shardingsphere]
Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on code in PR #29277:
URL: https://github.com/apache/shardingsphere/pull/29277#discussion_r1413828283
##########
kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/api/CDCJobAPI.java:
##########
@@ -226,6 +226,7 @@ private void enable(final String jobId) {
jobConfigPOJO.setDisabled(false);
jobConfigPOJO.getProps().setProperty("start_time_millis", String.valueOf(System.currentTimeMillis()));
jobConfigPOJO.getProps().remove("stop_time_millis");
+ jobConfigPOJO.getProps().remove("stop_time");
Review Comment:
Could we just save `stop_time` or `stop_time_millis` in registry center?
##########
kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/OpenGaussWALDumper.java:
##########
@@ -96,7 +94,7 @@ protected void runBlocking() {
int times = reconnectTimes.incrementAndGet();
log.error("Connect failed, reconnect times={}", times, ex);
if (isRunning()) {
- Thread.sleep(5000L);
+ sleepIgnoreInterrupt(5000L);
Review Comment:
When InterruptedException is thrown, `break` while loop might be necessary, but not just ignore it. It might cause dumper could not be paused.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org