This repository was archived by the owner on Apr 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 111
FALCON-2300, Backlog Metrics Workflow Failure Fix #384
Open
PracheerAgarwal-zz
wants to merge
29
commits into
apache:master
Choose a base branch
from
PracheerAgarwal-zz:FALCON-795
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
622cae4
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz daa3ffc
FALCON-2225 extension owner added for trusted extensions
PracheerAgarwal-zz 46042fd
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz 7f572a1
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz b20f044
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 066c8e2
Merge branch 'master' of https://github.com/apache/falcon
e3728d5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal a93d71a
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal fda3b28
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz a932633
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal e39808d
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 778c579
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal-zz 9cd8c17
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 9c2f0a5
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 9ff05df
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz ed65aa0
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz ba60452
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 7814fba
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz fc6ef2b
Merge branch 'master' of https://github.com/apache/falcon
41da933
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal 2e12279
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz 7f3932c
Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
PracheerAgarwal 03bedde
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz f8fde4f
Merge branch 'master' of https://github.com/apache/falcon
PracheerAgarwal-zz fdc9b82
FALCON-795 logging statements added
PracheerAgarwal-zz 73d47e3
test
PracheerAgarwal-zz 1bf815f
FALCON-795 logging statements added
PracheerAgarwal-zz afdf0bd
Removing unused imports
PracheerAgarwal-zz b367f34
checkstyle errors
PracheerAgarwal-zz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ | |
| import org.apache.falcon.security.CurrentUser; | ||
| import org.apache.falcon.util.DateUtil; | ||
| import org.apache.falcon.util.DeploymentUtil; | ||
| import org.apache.falcon.util.RuntimeProperties; | ||
| import org.apache.falcon.util.StartupProperties; | ||
| import org.apache.falcon.workflow.WorkflowEngineFactory; | ||
| import org.apache.falcon.workflow.engine.AbstractWorkflowEngine; | ||
|
|
@@ -207,6 +208,7 @@ public void onRemove(Entity entity) throws FalconException { | |
| if (feed.getSla() != null && feed.getLocations() != null) { | ||
| for (Cluster cluster : feed.getClusters().getClusters()) { | ||
| if (currentClusters.contains(cluster.getName()) && FeedHelper.getSLA(cluster, feed) != null) { | ||
| LOG.debug("Removing feed:{} for monitoring", feed.getName()); | ||
| MONITORING_JDBC_STATE_STORE.deleteMonitoringEntity(feed.getName(), EntityType.FEED.toString()); | ||
| MONITORING_JDBC_STATE_STORE.deletePendingInstances(feed.getName(), cluster.getName(), | ||
| EntityType.FEED.toString()); | ||
|
|
@@ -218,6 +220,7 @@ public void onRemove(Entity entity) throws FalconException { | |
| Process process = (Process) entity; | ||
| if (process.getSla() != null){ | ||
| for (org.apache.falcon.entity.v0.process.Cluster cluster : process.getClusters().getClusters()) { | ||
| LOG.debug("Removing process:{} for monitoring", process.getName()); | ||
| if (currentClusters.contains(cluster.getName())) { | ||
| MONITORING_JDBC_STATE_STORE.deleteMonitoringEntity(process.getName(), | ||
| EntityType.PROCESS.toString()); | ||
|
|
@@ -316,6 +319,7 @@ public void init() throws FalconException { | |
|
|
||
| freq = StartupProperties.get().getProperty("entity.sla.lookAheadWindow.millis", "900000"); | ||
| lookAheadWindowMillis = Integer.parseInt(freq); | ||
|
|
||
| ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1); | ||
| addPendingEntityInstances(now()); | ||
| executor.scheduleWithFixedDelay(new Monitor(), 0, statusCheckFrequencySeconds, TimeUnit.SECONDS); | ||
|
|
@@ -364,6 +368,8 @@ public void run() { | |
| // add Instances from last checked time to 10 minutes from now(some buffer for status check) | ||
| Date newCheckPointTime = new Date(now().getTime() + lookAheadWindowMillis); | ||
| addPendingEntityInstances(newCheckPointTime); | ||
| } else { | ||
| LOG.debug("No entities present for sla monitoring."); | ||
| } | ||
| } catch (Throwable e) { | ||
| LOG.error("Feed SLA monitoring failed: ", e); | ||
|
|
@@ -449,8 +455,13 @@ private boolean checkEntityInstanceAvailability(String entityName, String cluste | |
| if (entityType.equalsIgnoreCase(EntityType.PROCESS.toString())){ | ||
| LOG.trace("Checking instance availability status for entity:{}, cluster:{}, " | ||
| + "instanceTime:{}", entity.getName(), clusterName, nominalTime, entityType); | ||
| AbstractWorkflowEngine wfEngine = WorkflowEngineFactory.getWorkflowEngine(); | ||
|
|
||
| if ((System.currentTimeMillis() - nominalTime.getTime())/(1000*60*60*24) >= Integer.parseInt( | ||
| RuntimeProperties.get().getProperty("worklflow.expiration.period", "7"))) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the property name to a constant field. Also, the property name can be : |
||
| return true; | ||
| } | ||
|
|
||
| AbstractWorkflowEngine wfEngine = WorkflowEngineFactory.getWorkflowEngine(); | ||
| InstancesResult instancesResult = wfEngine.getStatus(entity, nominalTime, | ||
| new Date(nominalTime.getTime() + 200), PROCESS_LIFE_CYCLE, false); | ||
| if (instancesResult.getInstances().length > 0) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the else part of
if (instancesResult.getInstances().length > 0).. Lets not eagerly assume the instance info is not available.