You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/10/23 20:16:30 UTC
[GitHub] [incubator-gobblin] jack-moseley opened a new pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
jack-moseley opened a new pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
### JIRA
- [x] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
- https://issues.apache.org/jira/browse/GOBBLIN-1300
### Description
- [x] Here are some details about my PR, including screenshots (if applicable):
Exceptions from parsing the message should be caught, but not exceptions when storing job status in state store.
### Tests
- [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
trivial
### Commits
- [x] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#discussion_r511157047
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java
##########
@@ -134,6 +134,8 @@ protected void processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
if (jobStatus != null) {
try(Timer.Context context = getMetricContext().timer(GET_AND_SET_JOB_STATUS).time()) {
addJobStatusToStateStore(jobStatus, this.stateStore);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to add job status to state store", ioe);
Review comment:
The outer one is catching failures to parse job status from the kafka message, which we are treating differently from failure to store the job status in the state store.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#discussion_r511136206
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java
##########
@@ -134,6 +134,8 @@ protected void processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
if (jobStatus != null) {
try(Timer.Context context = getMetricContext().timer(GET_AND_SET_JOB_STATUS).time()) {
addJobStatusToStateStore(jobStatus, this.stateStore);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to add job status to state store", ioe);
Review comment:
Add a comment here explaining why we are propagating the exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#discussion_r511136877
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java
##########
@@ -134,6 +134,8 @@ protected void processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
if (jobStatus != null) {
try(Timer.Context context = getMetricContext().timer(GET_AND_SET_JOB_STATUS).time()) {
addJobStatusToStateStore(jobStatus, this.stateStore);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to add job status to state store", ioe);
Review comment:
Also why do we two catch IOException blocks? Isn't the outer catch block for the exception thrown by addJobStatusToStateStore?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#discussion_r511174687
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaAvroJobStatusMonitor.java
##########
@@ -86,10 +87,15 @@ protected void createMetrics() {
}
@Override
- public org.apache.gobblin.configuration.State parseJobStatus(byte[] message)
- throws IOException {
+ public org.apache.gobblin.configuration.State parseJobStatus(byte[] message) {
InputStream is = new ByteArrayInputStream(message);
- schemaVersionWriter.readSchemaVersioningInformation(new DataInputStream(is));
+ try {
Review comment:
Can we merge the two try..catch blocks into one?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
sv2000 commented on a change in pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#discussion_r511167846
##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java
##########
@@ -134,6 +134,8 @@ protected void processMessage(DecodeableKafkaRecord<byte[],byte[]> message) {
if (jobStatus != null) {
try(Timer.Context context = getMetricContext().timer(GET_AND_SET_JOB_STATUS).time()) {
addJobStatusToStateStore(jobStatus, this.stateStore);
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to add job status to state store", ioe);
Review comment:
parseJobStatus method can be modified to swallow the IOException. It seems to be doing that for most part anyways. The IOException being thrown by readSchemaVersioningInformation can be caught inside the method.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] asfgit closed pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-gobblin] jack-moseley commented on pull request #3138: [GOBBLIN-1300] Rethrow exceptions when storing job status in state store
Posted by GitBox <gi...@apache.org>.
jack-moseley commented on pull request #3138:
URL: https://github.com/apache/incubator-gobblin/pull/3138#issuecomment-715569697
@sv2000 please review
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org