Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374849 )

Change subject: Don't failmail on first cURL retry
......................................................................

Don't failmail on first cURL retry

We should log all the verbose cURL output on each request failure.
Only send failmail if cURL still can't get through after all the
retry attempts run out.

Change-Id: I5fbdd476227319d5270c3f9ae93bb7d2812c3c46
---
M Core/Http/CurlWrapper.php
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/49/374849/1

diff --git a/Core/Http/CurlWrapper.php b/Core/Http/CurlWrapper.php
index 45c749c..9499e29 100644
--- a/Core/Http/CurlWrapper.php
+++ b/Core/Http/CurlWrapper.php
@@ -67,13 +67,21 @@
                                $errno = curl_errno( $ch );
                                $err = curl_error( $ch );
 
-                               Logger::alert(
-                                       "cURL transaction to {$url} failed: 
($errno) $err.  " .
+                               Logger::warning(
+                                       "cURL transaction to {$url} failed: 
($errno) $err. " .
                                        "cURL verbose logging: $logged"
                                );
                        }
                        $tries++;
                        if ( $tries >= $loopCount ) {
+                               if ( $continue ) {
+                                       // We ran out of retries, but 
apparently still haven't got
+                                       // anything good. Squawk.
+                                       Logger::alert(
+                                               "cURL transaction to {$url} 
failed {$loopCount} times! " .
+                                               'Please see previous 
warning-level logs for details.'
+                                       );
+                               }
                                $continue = false;
                        }
                } while ( $continue ); // End while cURL transaction hasn't 
returned something useful

-- 
To view, visit https://gerrit.wikimedia.org/r/374849
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5fbdd476227319d5270c3f9ae93bb7d2812c3c46
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to