From c310f2ab245c9fa84233240e8bddfb6d7f75e2b1 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 12 Mar 2008 17:37:00 +0000 Subject: * Since remoting exceptions occur quite often in some cases (e.g. when a neighbouring region is down), put out only the source and message of the RemotingException (not the stack trace) to the console. * It doesn't appear that the remoting stack trace yields any useful information anyway --- .../Region/Communications/OGS1/OGS1GridServices.cs | 96 +++++++++++++++------- 1 file changed, 65 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index cdafad3..b9b35c0 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -605,39 +605,55 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Socket Error: Unable to connect to adjacent region: " + " " + - regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (Exception e) { NoteDeadRegion(regionHandle); - m_log.Debug(e.ToString()); + + m_log.WarnFormat("Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("{0} {1}", e.Source, e.Message); + return false; } } @@ -700,41 +716,56 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (SocketException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + - regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (InvalidCredentialException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (AuthenticationException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Authentication exception: Unable to connect to adjacent region: " + - regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch (Exception e) { NoteDeadRegion(regionHandle); - m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } } @@ -994,9 +1025,12 @@ namespace OpenSim.Region.Communications.OGS1 catch (RemotingException e) { NoteDeadRegion(regionHandle); - m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + - " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.Debug(e.ToString()); + + m_log.WarnFormat( + "Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", + regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); + m_log.DebugFormat("Remoting Error: {0} {1}", e.Source, e.Message); + return false; } catch -- cgit v1.1