You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "umustafi (via GitHub)" <gi...@apache.org> on 2023/11/09 01:28:50 UTC
[PR] Fix FlowSpec Updating Function [gobblin]
umustafi opened a new pull request, #3823:
URL: https://github.com/apache/gobblin/pull/3823
* makes Config object with FlowSpec mutable
* adds unit test to ensure flow compiles after updating FlowSpec
* ensure DagManager resilient to exceptions on leadership change
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-1954
### Description
- [X] Here are some details about my PR, including screenshots (if applicable):
When copying a `flowSpec` to add `flowExecutionId` into its config, all components need to be carefully duplicated to ensure compilation, serialization and deserialization are successful. Some pieces can easily be missed so instead, we add the property to the `Properties` object of the `FlowSpec` which is mutable. Note that we do not update the `Config` object to avoid large GC overhead from deleting and creating a new `Config` object. This test also ensures that the `DagManager` thread will not silently die during leadership changes by catching all types of `Exceptions`.
### Tests
- [X] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
- Updates FlowSpecTest
- Adds unit test to FlowCompilationValidationHelper to ensure the flow compiles and produces a valid execution plan after being updated
### 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.
To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1393037130
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -504,9 +504,12 @@ public void handleLaunchFlowEvent(DagActionStore.DagAction launchAction) {
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
FlowSpec spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
Optional<Dag<JobExecutionPlan>> optionalJobExecutionPlanDag =
- this.flowCompilationValidationHelper.createExecutionPlanIfValid(spec);
+ this.flowCompilationValidationHelper.createExecutionPlanIfValid(spec, Optional.absent());
if (optionalJobExecutionPlanDag.isPresent()) {
addDag(optionalJobExecutionPlanDag.get(), true, true);
+ } else {
+ log.warn("Failed flow compilation of spec causing launch flow event to be skipped on startup. Flow {}", flowId);
+ this.dagManagerMetrics.incrementFailedLaunchCount();
Review Comment:
doesn't actually say what/how it failed flow compilation... is that because such a message would have already been logged?
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java:
##########
@@ -177,11 +179,14 @@ public static void populateFlowCompilationFailedEventMessage(Optional<EventSubmi
}
/**
- * If it is a scheduled flow (and hence, does not have flowExecutionId in the FlowSpec) and the flow compilation is
- * successful, retrieve the flowExecutionId from the JobSpec.
+ * If it is a scheduled flow (which does not have flowExecutionId in the FlowSpec) and the flow compilation is
+ * successful, add a flowExecutionId using the optional parameter if it exists otherwise retrieve it from the JobSpec.
*/
public static void addFlowExecutionIdIfAbsent(Map<String,String> flowMetadata,
- Dag<JobExecutionPlan> jobExecutionPlanDag) {
+ Optional<String> optionalFlowExecutionId, Dag<JobExecutionPlan> jobExecutionPlanDag) {
Review Comment:
tip: rather than updating various existing invocations to pass `Optional.absent()`, create an overloaded version and centralize all migration there:
```
public static void addFlowExecutionIdIfAbsent(Map<String,String> flowMetadata, Dag<JobExecutionPlan> jobExecutionPlanDag) {
addFlowExecutionIdIfAbsent(flowMetadata, Optional.absent(), jobExecutionPlanDag);
}
```
##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelperTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.gobblin.service.modules.utils;
+
+import com.google.common.base.Optional;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import org.apache.gobblin.metrics.event.TimingEvent;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.orchestration.DagTestUtils;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.junit.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+
+/**
+ * Test functionality provided by the helper class re-used between the DagManager and Orchestrator for flow compilation.
+ */
+public class FlowCompilationValidationHelperTest {
+ private String dagId = "testDag";
+ private Long jobSpecFlowExecutionId = 1234L;
+ private String newFlowExecutionId = "5678";
+ private String existingFlowExecutionId = "9999";
+ private Dag<JobExecutionPlan> jobExecutionPlanDag;
+
+ @BeforeClass
+ public void setup() throws URISyntaxException {
+ jobExecutionPlanDag = DagTestUtils.buildDag(dagId, jobSpecFlowExecutionId);
+
+ }
+
+ /*
+ Tests that addFlowExecutionIdIfAbsent adds flowExecutionId to a flowMetadata object when it is absent, prioritizing
+ the optional flowExecutionId over the one from the job spec
+ */
+ @Test
+ public void testAddFlowExecutionIdWhenAbsent() {
Review Comment:
shall we also test the third case, where it's not present originally and also not provided as an `Optional`?
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java:
##########
@@ -64,10 +64,12 @@ public final class FlowCompilationValidationHelper {
* For a given a flowSpec, verifies that an execution is allowed (in case there is an ongoing execution) and the
* flowspec can be compiled. If the pre-conditions hold, then a JobExecutionPlan is constructed and returned to the
* caller.
+ * @param flowSpec
+ * @param optionalFlowExecutionId provided for executions of scheduled events which should use a consistent id
* @return jobExecutionPlan dag if one can be constructed for the given flowSpec
*/
- public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec)
- throws IOException, InterruptedException {
+ public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec,
+ Optional<String> optionalFlowExecutionId) throws IOException, InterruptedException {
Review Comment:
though not related to this PR's changes per se, just noting that guava lib upgrades cause us considerable hassle, and a special challenge we'd face if we ever elect to shade guava classes, would arise from using guava types as params or return types.
unless there's a pressing mandate to use guava `Optional`, we should always prefer `java.util.Optional`. (guava has been deprecated in favor of that one for a very long time.)
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java:
##########
@@ -64,10 +64,12 @@ public final class FlowCompilationValidationHelper {
* For a given a flowSpec, verifies that an execution is allowed (in case there is an ongoing execution) and the
* flowspec can be compiled. If the pre-conditions hold, then a JobExecutionPlan is constructed and returned to the
* caller.
+ * @param flowSpec
+ * @param optionalFlowExecutionId provided for executions of scheduled events which should use a consistent id
Review Comment:
how about
```
for scheduled (non-ad-hoc) flows, to pass the ID "laundered" via the DB; see: {@link MultiActiveLeaseArbiter#whateverMethodHasJavadocToDescribe}
```
?
i.e. there should already be good docs about this, so merely help the maintainer find them w/ a link
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388721063
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -125,6 +125,18 @@ public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) {
throw new RuntimeException("Unable to create a FlowSpec URI: " + e, e);
}
}
+
+ /**
+ * Add new property at the specified path to the configAsProperties objects.
+ * Note: this does NOT update the Config so any property added through this function must be retrieved through the
+ * ConfigAsProperties field
Review Comment:
may be error prone... why not instead create a new `Config` and update the reference to point to that one? given immutability, k-v pairs in common (the vast majority) should be readily shared, for minimal performance penalty. I believe you'd create the successor using `Config::withFallback` (but I'm not 100% sure)
do be sure to synchronize an update of `configAsProperties` at that same time.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388695256
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
We are not catching `NullPointerException` that occurred here https://github.com/apache/gobblin/blob/9e30c6c3bca857942fba5d10345b1be14adc1942/gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java#L435 we're only catching IOException which results in leader transition silently not completing if NPE or something occurs. It is printing the stack trace but we already set `this.active = true beforehand` so it remains as leader.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388949632
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
1) why do we set this.active=true when it is not ready yet to act as a leader?
2) should we just reverse the leadership change in the catch block then?
3) basically the only difference this change is making is printing a log line. lets try to handle the exception(including runtime) gracefully.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1393412720
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java:
##########
@@ -64,10 +64,12 @@ public final class FlowCompilationValidationHelper {
* For a given a flowSpec, verifies that an execution is allowed (in case there is an ongoing execution) and the
* flowspec can be compiled. If the pre-conditions hold, then a JobExecutionPlan is constructed and returned to the
* caller.
+ * @param flowSpec
+ * @param optionalFlowExecutionId provided for executions of scheduled events which should use a consistent id
* @return jobExecutionPlan dag if one can be constructed for the given flowSpec
*/
- public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec)
- throws IOException, InterruptedException {
+ public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec,
+ Optional<String> optionalFlowExecutionId) throws IOException, InterruptedException {
Review Comment:
The other optionals used in this class are the guava one and reliant on intertwined `Orchestrator/DagManager` code.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#issuecomment-1805170278
## [Codecov](https://app.codecov.io/gh/apache/gobblin/pull/3823?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#3823](https://app.codecov.io/gh/apache/gobblin/pull/3823?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (3001cd6) into [master](https://app.codecov.io/gh/apache/gobblin/commit/9e30c6c3bca857942fba5d10345b1be14adc1942?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (9e30c6c) will **decrease** coverage by `1.54%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #3823 +/- ##
============================================
- Coverage 47.54% 46.01% -1.54%
+ Complexity 11033 2181 -8852
============================================
Files 2156 416 -1740
Lines 85368 17984 -67384
Branches 9491 2194 -7297
============================================
- Hits 40591 8275 -32316
+ Misses 41082 8825 -32257
+ Partials 3695 884 -2811
```
[see 1741 files with indirect coverage changes](https://app.codecov.io/gh/apache/gobblin/pull/3823/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in [Chrome](https://chrome.google.com/webstore/detail/codecov/gedikamndpbemklijjkncpnolildpbgo) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/codecov/) today!
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1391792468
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
I am updating it to catch `RuntimeException` then. How about that for the error catching?
I was thinking about setting this.active after we finish all the work, but the reason we may set it before is that loading all dags from state store and initializing may take time but in meantime we still want to accept new requests. I want to limit scope of significant change like that which may increase downtime.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1391800736
##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelperTest.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.gobblin.service.modules.utils;
+
+import com.google.common.base.Optional;
+import java.io.IOException;
+import java.util.Properties;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.metrics.event.EventSubmitter;
+import org.apache.gobblin.runtime.api.FlowSpec;
+import org.apache.gobblin.service.modules.core.IdentityFlowToJobSpecCompilerTest;
+import org.apache.gobblin.service.modules.flow.IdentityFlowToJobSpecCompiler;
+import org.apache.gobblin.service.modules.flow.SpecCompiler;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.orchestration.UserQuotaManager;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.apache.gobblin.service.monitoring.FlowStatusGenerator;
+import org.apache.gobblin.util.ConfigUtils;
+import org.junit.Assert;
+import org.testng.annotations.Test;
+
+import static org.mockito.Mockito.*;
+
+
+/**
+ * Test functionality provided by the helper class re-used between the DagManager and Orchestrator for flow compilation.
+ */
+public class FlowCompilationValidationHelperTest {
+
+ class MockFlowCompilationValidationHelper extends FlowCompilationValidationHelper {
+
+ public MockFlowCompilationValidationHelper(SharedFlowMetricsSingleton sharedFlowMetricsSingleton,
+ SpecCompiler specCompiler, UserQuotaManager quotaManager, Optional<EventSubmitter> eventSubmitter,
+ FlowStatusGenerator flowStatusGenerator, boolean isFlowConcurrencyEnabled) {
+ super(sharedFlowMetricsSingleton, specCompiler, quotaManager, eventSubmitter, flowStatusGenerator,
+ isFlowConcurrencyEnabled);
+ }
+
+ /*
+ In overriden function simply return if concurrent execution is allowed or not because flowStatusGenerator will be
+ mocked
+ */
+ @Override
+ protected boolean isExecutionPermitted(FlowStatusGenerator flowStatusGenerator, String flowName, String flowGroup,
+ boolean allowConcurrentExecution) {
+ return allowConcurrentExecution;
+ }
+
+ }
+
+ /*
+ Creates a mock {@link FlowCompilationValidationHelper} which has a valid {@link SpecCompiler} but mocks other
+ components.
+ */
+ MockFlowCompilationValidationHelper createMockFlowCompilationValidationHelper(boolean isFlowConcurrencyEnabled) {
+ SpecCompiler specCompiler = new IdentityFlowToJobSpecCompiler(ConfigUtils.propertiesToConfig(new Properties()));
+ specCompiler.onAddSpec(IdentityFlowToJobSpecCompilerTest.initTopologySpec());
+ return new MockFlowCompilationValidationHelper(mock(SharedFlowMetricsSingleton.class), specCompiler,
+ mock(UserQuotaManager.class), Optional.of(mock(EventSubmitter.class)), mock(FlowStatusGenerator.class),
+ isFlowConcurrencyEnabled);
+ }
+
+ /**
+ * Verifies that a flow spec that compiles to create a valid job execution plan dag will also generate one after
+ * having a flow execution id key-value pair added to its config
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ @Test
+ public void compileFlowSpec() throws IOException, InterruptedException {
Review Comment:
I tried to extend this test for `serialization/deserialization` using the `convertDagIntoState / convertStateObjIntoDag` methods from `MysqlDagStateStore`, however right after compiling the FlowSpec is not ready for serialization/deserialization as there are more properties that are initialized and added to the `JobExecutionPlan dag` ie: `Future` and various URIs. I actually will remove the `FlowSpec` update completely to avoid these sort of issues.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1392994851
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,8 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (RuntimeException | IOException e) {
Review Comment:
Okay I will address this in a separate PR bc we need to actually change `GobblinServiceManager.handleLeadershipChange` to disconnect from Helix if the `DagManager.setActive` method throw an 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.
To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "Will-Lo (via GitHub)" <gi...@apache.org>.
Will-Lo merged PR #3823:
URL: https://github.com/apache/gobblin/pull/3823
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1393415907
##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelperTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.gobblin.service.modules.utils;
+
+import com.google.common.base.Optional;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import org.apache.gobblin.metrics.event.TimingEvent;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.orchestration.DagTestUtils;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.junit.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+
+/**
+ * Test functionality provided by the helper class re-used between the DagManager and Orchestrator for flow compilation.
+ */
+public class FlowCompilationValidationHelperTest {
+ private String dagId = "testDag";
+ private Long jobSpecFlowExecutionId = 1234L;
+ private String newFlowExecutionId = "5678";
+ private String existingFlowExecutionId = "9999";
+ private Dag<JobExecutionPlan> jobExecutionPlanDag;
+
+ @BeforeClass
+ public void setup() throws URISyntaxException {
+ jobExecutionPlanDag = DagTestUtils.buildDag(dagId, jobSpecFlowExecutionId);
+
+ }
+
+ /*
+ Tests that addFlowExecutionIdIfAbsent adds flowExecutionId to a flowMetadata object when it is absent, prioritizing
+ the optional flowExecutionId over the one from the job spec
+ */
+ @Test
+ public void testAddFlowExecutionIdWhenAbsent() {
Review Comment:
I tried to test this case and realized the `dagNode` creation util does not actually set the right `flowExecutionId` key (using `ConfigurationKeys` as opposed to `TimingEvent.FlowEventConstants.FLOW_EXECUTION_ID_FIELD)`https://github.com/apache/gobblin/blob/315d9599e08521dd71ae6dccb09b7f7254961564/gobblin-service/src/test/java/org/apache/gobblin/service/modules/orchestration/DagTestUtils.java#L81 I don't think it's worth creating duplicate method to set the key in a test util then test extracting it. The above tests are probably sufficient since it's testing extracting map keys and putting if absent.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1393393693
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -504,9 +504,12 @@ public void handleLaunchFlowEvent(DagActionStore.DagAction launchAction) {
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
FlowSpec spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
Optional<Dag<JobExecutionPlan>> optionalJobExecutionPlanDag =
- this.flowCompilationValidationHelper.createExecutionPlanIfValid(spec);
+ this.flowCompilationValidationHelper.createExecutionPlanIfValid(spec, Optional.absent());
if (optionalJobExecutionPlanDag.isPresent()) {
addDag(optionalJobExecutionPlanDag.get(), true, true);
+ } else {
+ log.warn("Failed flow compilation of spec causing launch flow event to be skipped on startup. Flow {}", flowId);
+ this.dagManagerMetrics.incrementFailedLaunchCount();
Review Comment:
Yep, we don't have that information available here yet. We emit a flow compilation failed event that we can check https://github.com/apache/gobblin/blob/9e30c6c3bca857942fba5d10345b1be14adc1942/gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java#L89
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388945579
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
- FlowSpec updatedSpec = FlowSpec.Utils.createFlowSpecWithProperty(spec, ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
- this.orchestrator.submitFlowToDagManager(updatedSpec);
+ spec.addPropertyToConfigAsProperties(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
Review Comment:
This is where we add flow.execution.id.
In li-gobblin AzkabanHeadlessProducer we get the configs
`Map<String, String> flowParameters = new HashMap<>(Maps.fromProperties(ConfigUtils.configToProperties(jobConfig)));`
and there we use configs from `config` object. so you have to make change there also, if you want this approach to work. lets think more thoroughly which approach is better and more intuitive.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388696077
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
- FlowSpec updatedSpec = FlowSpec.Utils.createFlowSpecWithProperty(spec, ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
- this.orchestrator.submitFlowToDagManager(updatedSpec);
+ spec.addPropertyToConfigAsProperties(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
Review Comment:
Yes we query here from `ConfigAsProperties` https://github.com/apache/gobblin/blob/9e30c6c3bca857942fba5d10345b1be14adc1942/gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java#L186
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1393412720
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelper.java:
##########
@@ -64,10 +64,12 @@ public final class FlowCompilationValidationHelper {
* For a given a flowSpec, verifies that an execution is allowed (in case there is an ongoing execution) and the
* flowspec can be compiled. If the pre-conditions hold, then a JobExecutionPlan is constructed and returned to the
* caller.
+ * @param flowSpec
+ * @param optionalFlowExecutionId provided for executions of scheduled events which should use a consistent id
* @return jobExecutionPlan dag if one can be constructed for the given flowSpec
*/
- public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec)
- throws IOException, InterruptedException {
+ public Optional<Dag<JobExecutionPlan>> createExecutionPlanIfValid(FlowSpec flowSpec,
+ Optional<String> optionalFlowExecutionId) throws IOException, InterruptedException {
Review Comment:
The other optionals used in this class are the guava one and reliant on intertwined `Orchestrator/DagManager` code. I want to avoid the inconsistency in this class for now.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "Will-Lo (via GitHub)" <gi...@apache.org>.
Will-Lo commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1392886657
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,8 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (RuntimeException | IOException e) {
Review Comment:
Catching the runtime exception here wouldn't do anything because we're rethrowing the runtime exception as a runtime 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.
To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388673472
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
- FlowSpec updatedSpec = FlowSpec.Utils.createFlowSpecWithProperty(spec, ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
- this.orchestrator.submitFlowToDagManager(updatedSpec);
+ spec.addPropertyToConfigAsProperties(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
Review Comment:
can you point me to the code where we query this flow execution id?
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "umustafi (via GitHub)" <gi...@apache.org>.
umustafi commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1391794351
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
Catching and throwing the exception will fall the service health check so the service deploy/startup will fail if we encounter NPE. Previously it would silently fail initialization is the issue.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#issuecomment-1805156417
One idea to tackle the issue of changing flow spec config without recreating a Config object is to have have config (for immutable configs) and extendedProperties(java.util.properties, for the stuff that change) in a flowspec. extendedProperties should not be initially a copy of what is there in Config.
any command to lookup for a config should first search in extendedProperties and then in config.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "Will-Lo (via GitHub)" <gi...@apache.org>.
Will-Lo commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388702178
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
- FlowSpec updatedSpec = FlowSpec.Utils.createFlowSpecWithProperty(spec, ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
- this.orchestrator.submitFlowToDagManager(updatedSpec);
+ spec.addPropertyToConfigAsProperties(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
Review Comment:
We need to be careful here for adhoc flows that already save a flow execution ID in the flowspec configs, for those do we know if the flow execution ID in their config is consistent if they don't have a trigger time, or should we check if the property already exists in properties to not override them?
##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/utils/FlowCompilationValidationHelperTest.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.gobblin.service.modules.utils;
+
+import com.google.common.base.Optional;
+import java.io.IOException;
+import java.util.Properties;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.metrics.event.EventSubmitter;
+import org.apache.gobblin.runtime.api.FlowSpec;
+import org.apache.gobblin.service.modules.core.IdentityFlowToJobSpecCompilerTest;
+import org.apache.gobblin.service.modules.flow.IdentityFlowToJobSpecCompiler;
+import org.apache.gobblin.service.modules.flow.SpecCompiler;
+import org.apache.gobblin.service.modules.flowgraph.Dag;
+import org.apache.gobblin.service.modules.orchestration.UserQuotaManager;
+import org.apache.gobblin.service.modules.spec.JobExecutionPlan;
+import org.apache.gobblin.service.monitoring.FlowStatusGenerator;
+import org.apache.gobblin.util.ConfigUtils;
+import org.junit.Assert;
+import org.testng.annotations.Test;
+
+import static org.mockito.Mockito.*;
+
+
+/**
+ * Test functionality provided by the helper class re-used between the DagManager and Orchestrator for flow compilation.
+ */
+public class FlowCompilationValidationHelperTest {
+
+ class MockFlowCompilationValidationHelper extends FlowCompilationValidationHelper {
+
+ public MockFlowCompilationValidationHelper(SharedFlowMetricsSingleton sharedFlowMetricsSingleton,
+ SpecCompiler specCompiler, UserQuotaManager quotaManager, Optional<EventSubmitter> eventSubmitter,
+ FlowStatusGenerator flowStatusGenerator, boolean isFlowConcurrencyEnabled) {
+ super(sharedFlowMetricsSingleton, specCompiler, quotaManager, eventSubmitter, flowStatusGenerator,
+ isFlowConcurrencyEnabled);
+ }
+
+ /*
+ In overriden function simply return if concurrent execution is allowed or not because flowStatusGenerator will be
+ mocked
+ */
+ @Override
+ protected boolean isExecutionPermitted(FlowStatusGenerator flowStatusGenerator, String flowName, String flowGroup,
+ boolean allowConcurrentExecution) {
+ return allowConcurrentExecution;
+ }
+
+ }
+
+ /*
+ Creates a mock {@link FlowCompilationValidationHelper} which has a valid {@link SpecCompiler} but mocks other
+ components.
+ */
+ MockFlowCompilationValidationHelper createMockFlowCompilationValidationHelper(boolean isFlowConcurrencyEnabled) {
+ SpecCompiler specCompiler = new IdentityFlowToJobSpecCompiler(ConfigUtils.propertiesToConfig(new Properties()));
+ specCompiler.onAddSpec(IdentityFlowToJobSpecCompilerTest.initTopologySpec());
+ return new MockFlowCompilationValidationHelper(mock(SharedFlowMetricsSingleton.class), specCompiler,
+ mock(UserQuotaManager.class), Optional.of(mock(EventSubmitter.class)), mock(FlowStatusGenerator.class),
+ isFlowConcurrencyEnabled);
+ }
+
+ /**
+ * Verifies that a flow spec that compiles to create a valid job execution plan dag will also generate one after
+ * having a flow execution id key-value pair added to its config
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ @Test
+ public void compileFlowSpec() throws IOException, InterruptedException {
Review Comment:
Is it possible to extend this test to also test for serialization/deserialization of the jobexecutionplan that is stored in the dag just because that was the area that caused the fatal issues
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -125,6 +125,18 @@ public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) {
throw new RuntimeException("Unable to create a FlowSpec URI: " + e, e);
}
}
+
+ /**
Review Comment:
I prefer if we name this function something more semantic, such as `addMutableProperty` and a reader for it as `getMutableProperty` so that the user will not attempt to read from this.confgs.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "phet (via GitHub)" <gi...@apache.org>.
phet commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388723246
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -518,15 +530,5 @@ public static int maxFlowSpecUriLength() {
return URI_SCHEME.length() + ":".length() // URI separator
+ URI_PATH_SEPARATOR.length() + ServiceConfigKeys.MAX_FLOW_NAME_LENGTH + URI_PATH_SEPARATOR.length() + ServiceConfigKeys.MAX_FLOW_GROUP_LENGTH;
}
-
- /**
- * Create a new FlowSpec object with the added property defined by path and value parameters
- * @param path key for new property
- * @param value
- */
- public static FlowSpec createFlowSpecWithProperty(FlowSpec flowSpec, String path, String value) {
- Config updatedConfig = flowSpec.getConfig().withValue(path, ConfigValueFactory.fromAnyRef(value));
- return new Builder(flowSpec.getUri()).withConfig(updatedConfig).build();
Review Comment:
my hunch is that this `.build()` is what generated all the garbage. most likely the conversion of config to props
##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -125,6 +125,18 @@ public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) {
throw new RuntimeException("Unable to create a FlowSpec URI: " + e, e);
}
}
+
+ /**
+ * Add new property at the specified path to the configAsProperties objects.
+ * Note: this does NOT update the Config so any property added through this function must be retrieved through the
+ * ConfigAsProperties field
Review Comment:
may be error prone... why not instead create a new `Config` and update the reference to point to that one? given immutability, k-v pairs in common (the vast majority) should be readily shared, for minimal performance penalty, so long as you create the new config using `Config::withFallback`
do be sure to synchronize an update of `configAsProperties` at that same time.
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
I agree w/ the spirit here, but `Throwable` is pretty severe to catch... it would even grab OOM and other `Error`s... do we want that, or should you merely catch `Exception`?
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
Review Comment:
this brief comment may not draw enough attention to how critical this is!
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388945579
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -203,8 +203,8 @@ protected void submitFlowToDagManagerHelper(String flowGroup, String flowName, S
URI flowUri = FlowSpec.Utils.createFlowSpecUri(flowId);
spec = (FlowSpec) flowCatalog.getSpecs(flowUri);
// Adds flowExecutionId to config to ensure they are consistent across hosts
- FlowSpec updatedSpec = FlowSpec.Utils.createFlowSpecWithProperty(spec, ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
- this.orchestrator.submitFlowToDagManager(updatedSpec);
+ spec.addPropertyToConfigAsProperties(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, flowExecutionId);
Review Comment:
this is where we add flow.execution.id
in li-gobblin AzkabanHeadlessProducer we get the configs
`Map<String, String> flowParameters = new HashMap<>(Maps.fromProperties(ConfigUtils.configToProperties(jobConfig)));`
and there we use configs from `config` object. so you have to make change there also, if you want this approach to work. lets think more thoroughly which approach is better and more intuitive.
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "arjun4084346 (via GitHub)" <gi...@apache.org>.
arjun4084346 commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1388670830
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,9 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (Throwable e) {
Review Comment:
1) With the current code (i.e. the left side) also, leader transition should fail. I did not get what are we trying to achieve here.
2) Is GobblinServiceManager (the caller of this method) not printing stacktrace?
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix FlowSpec Updating Function [gobblin]
Posted by "Will-Lo (via GitHub)" <gi...@apache.org>.
Will-Lo commented on code in PR #3823:
URL: https://github.com/apache/gobblin/pull/3823#discussion_r1392886657
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManager.java:
##########
@@ -484,7 +484,8 @@ public synchronized void setActive(boolean active) {
log.error("Exception encountered when shutting down DagManager threads.", e);
}
}
- } catch (IOException e) {
+ } catch (RuntimeException | IOException e) {
Review Comment:
Catching the runtime exception here wouldn't do anything because we're rethrowing the runtime 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.
To unsubscribe, e-mail: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org