Skip to content
Snippets Groups Projects
Commit 48367750 authored by Justin Berstler's avatar Justin Berstler Committed by Perry
Browse files

Do not retry /run on action containers

It should be assumed that /run only happens after /init which should itself ensure that the container is running and ready. With that in mind, it does not make sense to attempt to retry posting to the /run endpoint on connection failures. Such a failure is an indication that something catastrophic has happened to the container, and no attempt at recovery should be made.

This is accomplished by adding a "retry" flag to the appropriate HTTP utilities to control whether or not a retry should be attempted.
parent 9b7b3d75
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ class ContainerConnectionTests
val connection = new HttpUtils(hostWithPort, timeout, 1.B)
testHang = timeout * 2
val start = Instant.now()
val result = connection.post("/init", JsObject())
val result = connection.post("/init", JsObject(), retry=true)
val end = Instant.now()
val waited = end.toEpochMilli - start.toEpochMilli
result.isLeft shouldBe true
......@@ -108,7 +108,7 @@ class ContainerConnectionTests
Seq(null, "", "abc", """{"a":"B"}""", """["a", "b"]""").foreach { r =>
testStatusOK = code
testResponse = r
val result = connection.post("/init", JsObject())
val result = connection.post("/init", JsObject(), retry=true)
result shouldBe Right {
ContainerResponse(okStatus = testStatusOK, if (r != null) r else "", None)
}
......@@ -125,7 +125,7 @@ class ContainerConnectionTests
Seq("abc", """{"a":"B"}""", """["a", "b"]""").foreach { r =>
testStatusOK = code
testResponse = r
val result = connection.post("/init", JsObject())
val result = connection.post("/init", JsObject(), retry=true)
result shouldBe Right {
ContainerResponse(okStatus = testStatusOK, r.take(limit.toBytes.toInt), Some((r.length.B, limit)))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment