Skip to content

Commit 4bb29c5

Browse files
Merge pull request #463 from duhanmin/dev-1.0.1
解决schedules kill任务后EventcheckReceiver依旧在后台运行
2 parents a0c4753 + f8465ac commit 4bb29c5

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

dss-appconn/appconns/dss-eventchecker-appconn/src/main/scala/com/webank/wedatasphere/dss/appconn/eventchecker/execution/EventCheckerRefExecutionOperation.scala

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class EventCheckerRefExecutionOperation extends LongTermRefExecutionOperation w
3838

3939
private var service:DevelopmentService = _
4040
private val logger = LoggerFactory.getLogger(classOf[EventCheckerRefExecutionOperation])
41-
41+
private var killTag = false
4242

4343

4444

@@ -60,11 +60,14 @@ class EventCheckerRefExecutionOperation extends LongTermRefExecutionOperation w
6060
}
6161
}
6262

63-
override def kill(action: RefExecutionAction): Boolean = action match {
64-
case longTermAction: EventCheckerExecutionAction =>
65-
longTermAction.setKilledFlag(true)
66-
longTermAction.setState(RefExecutionState.Killed)
67-
true
63+
override def kill(action: RefExecutionAction): Boolean = {
64+
killTag = true
65+
action match {
66+
case longTermAction: EventCheckerExecutionAction =>
67+
longTermAction.setKilledFlag(true)
68+
longTermAction.setState(RefExecutionState.Killed)
69+
true
70+
}
6871
}
6972

7073
protected def putErrorMsg(errorMsg: String, t: Throwable, action: EventCheckerExecutionAction): EventCheckerExecutionAction = t match {
@@ -120,6 +123,10 @@ class EventCheckerRefExecutionOperation extends LongTermRefExecutionOperation w
120123
putErrorMsg("EventChecker run failed!" + t.getMessage, t, action)
121124
false
122125
})
126+
if(killTag) {
127+
killTag = false
128+
return RefExecutionState.Killed
129+
}
123130
}
124131
action.state
125132
}

0 commit comments

Comments
 (0)