summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-08-05 14:14:19 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2020-08-05 14:15:49 +0200
commit4b439208203cd584e158fd240a3a4a72d1248099 (patch)
tree77a39a9af9a792f8516e3d287df9547942aca46c
parentded246bb61b9b0f4ca658be45c1691844e1dc122 (diff)
basehttp: Correctly handle non-transient failure from RunData()
When we failed after a retry, we only communicated failure as transient, but this seems wrong, especially given that the code now always triggers a retry when Die() is called, as Die() closes the server fd. Instead, remove the error handling in that code path, and reuse the existing fatal-ish error code handling path.
-rw-r--r--methods/basehttp.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index cd319fce1..5e29e0ce1 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -770,21 +770,11 @@ int BaseHttpMethod::Loop()
}
else
{
- if (Server->IsOpen() == false)
+ if (Server->IsOpen() == false && FailCounter < 1)
{
FailCounter++;
Server->Close();
-
-
- if (FailCounter >= 2)
- {
- Fail(true);
- FailCounter = 0;
- }
- else
- {
- _error->Discard();
- }
+ _error->Discard();
// Reset the pipeline
QueueBack = Queue;
@@ -794,6 +784,7 @@ int BaseHttpMethod::Loop()
else
{
Server->Close();
+ FailCounter = 0;
switch (Result)
{
case ResultState::TRANSIENT_ERROR: