Skip to content

Commit

Permalink
Include troubleshooting link in SiloUnavailableException
Browse files Browse the repository at this point in the history
(cherry picked from commit c357114)
  • Loading branch information
jdom committed Jul 11, 2016
1 parent 322d3d0 commit 06cef85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
31 changes: 12 additions & 19 deletions src/Orleans/Runtime/CallbackData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public CallbackData(
IMessagingConfiguration config)
{
// We are never called without a callback func, but best to double check.
if (callback == null) throw new ArgumentNullException("callback");
if (callback == null) throw new ArgumentNullException(nameof(callback));
// We are never called without a resend func, but best to double check.
if (resendFunc == null) throw new ArgumentNullException("resendFunc");
if (resendFunc == null) throw new ArgumentNullException(nameof(resendFunc));

this.callback = callback;
this.resendFunc = resendFunc;
Expand All @@ -61,7 +61,7 @@ public CallbackData(
public void StartTimer(TimeSpan time)
{
if (time < TimeSpan.Zero)
throw new ArgumentOutOfRangeException("time", "The timeout parameter is negative.");
throw new ArgumentOutOfRangeException(nameof(time), "The timeout parameter is negative.");
timeout = time;
if (StatisticsCollector.CollectApplicationRequestsStats)
{
Expand Down Expand Up @@ -93,9 +93,8 @@ public void OnTimeout()
var msg = Message; // Local working copy

string messageHistory = msg.GetTargetHistory();
string errorMsg = String.Format("Response did not arrive on time in {0} for message: {1}. Target History is: {2}",
timeout, msg, messageHistory);
logger.Warn(ErrorCode.Runtime_Error_100157, "{0}. About to break its promise.", errorMsg);
string errorMsg = $"Response did not arrive on time in {timeout} for message: {msg}. Target History is: {messageHistory}.";
logger.Warn(ErrorCode.Runtime_Error_100157, "{0} About to break its promise.", errorMsg);

var error = msg.CreatePromptExceptionResponse(new TimeoutException(errorMsg));
OnFail(msg, error, "OnTimeout - Resend {0} for {1}", true);
Expand All @@ -108,9 +107,9 @@ public void OnTargetSiloFail()

var msg = Message;
var messageHistory = msg.GetTargetHistory();
string errorMsg = string.Format("The target silo became unavailable for message: {0}. Target History is: {1}",
msg, messageHistory);
logger.Warn(ErrorCode.Runtime_Error_100157, "{0}. About to break its promise.", errorMsg);
string errorMsg =
$"The target silo became unavailable for message: {msg}. Target History is: {messageHistory}. See {Constants.TroubleshootingHelpLink} for troubleshooting help.";
logger.Warn(ErrorCode.Runtime_Error_100157, "{0} About to break its promise.", errorMsg);

var error = msg.CreatePromptExceptionResponse(new SiloUnavailableException(errorMsg));
OnFail(msg, error, "On silo fail - Resend {0} for {1}");
Expand Down Expand Up @@ -139,10 +138,7 @@ public void DoCallback(Message response)
{
timeSinceIssued.Stop();
}
if (unregister != null)
{
unregister();
}
unregister?.Invoke();
}
if (StatisticsCollector.CollectApplicationRequestsStats)
{
Expand All @@ -162,9 +158,9 @@ private void DisposeTimer()
{
try
{
if (timer != null)
var tmp = timer;
if (tmp != null)
{
var tmp = timer;
timer = null;
tmp.Dispose();
}
Expand Down Expand Up @@ -192,10 +188,7 @@ private void OnFail(Message msg, Message error, string resendLogMessageFormat, b
timeSinceIssued.Stop();
}

if (unregister != null)
{
unregister();
}
unregister?.Invoke();
}

if (StatisticsCollector.CollectApplicationRequestsStats)
Expand Down
2 changes: 2 additions & 0 deletions src/Orleans/Runtime/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ internal class Constants

public const string ORLEANS_ZOOKEEPER_UTILS_DLL = "OrleansZooKeeperUtils";

public const string TroubleshootingHelpLink = "https://aka.ms/orleans-troubleshooting";

public static readonly GrainId DirectoryServiceId = GrainId.GetSystemTargetGrainId(10);
public static readonly GrainId DirectoryCacheValidatorId = GrainId.GetSystemTargetGrainId(11);
public static readonly GrainId SiloControlId = GrainId.GetSystemTargetGrainId(12);
Expand Down

0 comments on commit 06cef85

Please sign in to comment.