Compare commits

...

2 Commits

Author SHA1 Message Date
Luke Tomlinson
ac7f83f61d feedback 2024-01-08 13:07:58 -08:00
Luke Tomlinson
d061d61093 Remove USE_BROKER_FLOW usage 2024-01-08 12:47:48 -08:00
4 changed files with 9 additions and 27 deletions

View File

@@ -183,18 +183,15 @@ namespace GitHub.Runner.Listener
public void OnJobStatus(object sender, JobStatusEventArgs e) public void OnJobStatus(object sender, JobStatusEventArgs e)
{ {
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("USE_BROKER_FLOW"))) Trace.Info("Received job status event. JobState: {0}", e.Status);
runnerStatus = e.Status;
try
{ {
Trace.Info("Received job status event. JobState: {0}", e.Status); _getMessagesTokenSource?.Cancel();
runnerStatus = e.Status; }
try catch (ObjectDisposedException)
{ {
_getMessagesTokenSource?.Cancel(); Trace.Info("_getMessagesTokenSource is already disposed.");
}
catch (ObjectDisposedException)
{
Trace.Info("_getMessagesTokenSource is already disposed.");
}
} }
} }

View File

@@ -62,11 +62,6 @@ namespace GitHub.Runner.Sdk
settings.SendTimeout = TimeSpan.FromSeconds(Math.Min(Math.Max(httpRequestTimeoutSeconds, 100), 1200)); settings.SendTimeout = TimeSpan.FromSeconds(Math.Min(Math.Max(httpRequestTimeoutSeconds, 100), 1200));
} }
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("USE_BROKER_FLOW")))
{
settings.AllowAutoRedirectForBroker = true;
}
// Remove Invariant from the list of accepted languages. // Remove Invariant from the list of accepted languages.
// //
// The constructor of VssHttpRequestSettings (base class of VssClientHttpRequestSettings) adds the current // The constructor of VssHttpRequestSettings (base class of VssClientHttpRequestSettings) adds the current

View File

@@ -215,7 +215,7 @@ namespace GitHub.Services.Common
// SyncronizationContext (such as ASP.NET's) which keeps things from deadlocking... // SyncronizationContext (such as ASP.NET's) which keeps things from deadlocking...
var tmpResponse = await m_messageInvoker.SendAsync(request, tokenSource.Token).ConfigureAwait(false); var tmpResponse = await m_messageInvoker.SendAsync(request, tokenSource.Token).ConfigureAwait(false);
if (Settings.AllowAutoRedirectForBroker && tmpResponse.StatusCode == HttpStatusCode.Redirect) if (tmpResponse.StatusCode == HttpStatusCode.Redirect)
{ {
//Dispose of the previous response //Dispose of the previous response
tmpResponse?.Dispose(); tmpResponse?.Dispose();

View File

@@ -110,16 +110,6 @@ namespace GitHub.Services.Common
set; set;
} }
/// <summary>
/// Gets or sets a value indicating whether or not HttpClientHandler should follow redirect on outgoing broker requests
/// This is special since this also sends token in the request, where as default AllowAutoRedirect does not
/// </summary>
public Boolean AllowAutoRedirectForBroker
{
get;
set;
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether or not compression should be used on outgoing requests. /// Gets or sets a value indicating whether or not compression should be used on outgoing requests.
/// The default value is true. /// The default value is true.