Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/226637

Change subject: Log exceptions in the StatsD process
......................................................................

Log exceptions in the StatsD process

Change-Id: Iff14cbbfbe81d38c55b41ff115c66156323df035
---
M includes/GlobalFunctions.php
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/226637/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 6f354c3..167305d 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1254,12 +1254,16 @@
 
        $config = $context->getConfig();
        if ( $config->get( 'StatsdServer' ) ) {
-               $statsdServer = explode( ':', $config->get( 'StatsdServer' ) );
-               $statsdHost = $statsdServer[0];
-               $statsdPort = isset( $statsdServer[1] ) ? $statsdServer[1] : 
8125;
-               $statsdSender = new SocketSender( $statsdHost, $statsdPort );
-               $statsdClient = new StatsdClient( $statsdSender );
-               $statsdClient->send( $context->getStats()->getBuffer() );
+               try {
+                       $statsdServer = explode( ':', $config->get( 
'StatsdServer' ) );
+                       $statsdHost = $statsdServer[0];
+                       $statsdPort = isset( $statsdServer[1] ) ? 
$statsdServer[1] : 8125;
+                       $statsdSender = new SocketSender( $statsdHost, 
$statsdPort );
+                       $statsdClient = new StatsdClient( $statsdSender, true, 
false );
+                       $statsdClient->send( $context->getStats()->getBuffer() 
);
+               } catch ( Exception $ex ) {
+                       MWExceptionHandler::logException( $ex );
+               }
        }
 
        # Profiling must actually be enabled...

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff14cbbfbe81d38c55b41ff115c66156323df035
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

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

Reply via email to