commit 203dd88
default
·
2023-08-09 17:36:31 +0000 UTC
parent 912cfb5
Be more strict in not retrying on permanent errors.
3 files changed,
+10,
-5
+2,
-2
1@@ -1430,8 +1430,8 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
2 /* bring the actor */
3 a_status = actor_request(snac, actor, &actor_o);
4
5- /* if the actor does not explicitly exist, discard */
6- if (a_status == 404 || a_status == 410) {
7+ /* do not retry permanent failures */
8+ if (a_status == 404 || a_status == 410 || a_status < 0) {
9 snac_debug(snac, 1,
10 xs_fmt("dropping message due to actor error %s %d", actor, a_status));
11
+7,
-2
1@@ -169,8 +169,13 @@ xs_dict *xs_http_request(const char *method, const char *url,
2 curl_slist_free_all(list);
3
4 if (status != NULL) {
5- if (lstatus == 0)
6- lstatus = -cc;
7+ if (lstatus == 0) {
8+ /* set the timeout error to a fake HTTP status, or propagate as is */
9+ if (cc == CURLE_OPERATION_TIMEDOUT)
10+ lstatus = 599;
11+ else
12+ lstatus = -cc;
13+ }
14
15 *status = (int) lstatus;
16 }
+1,
-1
1@@ -1 +1 @@
2-/* ac9fa6f1941aa3e701bbb1da50b4d5a07090eddb */
3+/* 246a8bc9941850f68bf9034662a8a96bcd33926d */