Skip to content

Commit 4956362

Browse files
authored
fixing ContainerProxy - don't terminate early on failures (#4969)
* fixing ContainerProxy - don't terminate early on failures * cleanup
1 parent 5109942 commit 4956362

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ class ContainerProxy(factory: (TransactionId,
335335
// implicitly via a FailureMessage which will be processed later when the state
336336
// transitions to Running
337337
val activation = ContainerProxy.constructWhiskActivation(job, None, Interval.zero, false, response)
338+
338339
sendActiveAck(
339340
transid,
340341
activation,
@@ -497,7 +498,8 @@ class ContainerProxy(factory: (TransactionId,
497498
activeCount -= 1
498499
context.parent ! ContainerRemoved(true)
499500
abortBuffered()
500-
stop()
501+
rescheduleJob = true
502+
goto(Removing)
501503

502504
case _ => delay
503505
}

tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerProxyTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ class ContainerProxyTests
13071307

13081308
expectMsg(ContainerRemoved(true))
13091309
//go to Removing state when a failure happens while others are in flight
1310-
expectNoMessage(100.milliseconds)
1310+
expectMsg(Transition(machine, Running, Removing))
13111311
awaitAssert {
13121312
factory.calls should have size 1
13131313
container.initializeCount shouldBe 0
@@ -1437,7 +1437,7 @@ class ContainerProxyTests
14371437
machine ! Run(action, message)
14381438
expectMsg(Transition(machine, Uninitialized, Running))
14391439
expectMsg(ContainerRemoved(true))
1440-
1440+
expectMsg(Transition(machine, Running, Removing))
14411441
awaitAssert {
14421442
factory.calls should have size 1
14431443
container.initializeCount shouldBe 0

0 commit comments

Comments
 (0)