Skip to content

Commit

Permalink
Temporary remove the NetworkTimeout (#20860)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym authored May 5, 2021
1 parent 8a30dbb commit 21f1f09
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net461.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public HttpMessage(Azure.Core.Request request, Azure.Core.ResponseClassifier res
public bool BufferResponse { get { throw null; } set { } }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public bool HasResponse { get { throw null; } }
public System.TimeSpan? NetworkTimeout { get { throw null; } set { } }
public Azure.Core.Request Request { get { throw null; } }
public Azure.Response Response { get { throw null; } set { } }
public Azure.Core.ResponseClassifier ResponseClassifier { get { throw null; } }
Expand Down
1 change: 0 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.net5.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public HttpMessage(Azure.Core.Request request, Azure.Core.ResponseClassifier res
public bool BufferResponse { get { throw null; } set { } }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public bool HasResponse { get { throw null; } }
public System.TimeSpan? NetworkTimeout { get { throw null; } set { } }
public Azure.Core.Request Request { get { throw null; } }
public Azure.Response Response { get { throw null; } set { } }
public Azure.Core.ResponseClassifier ResponseClassifier { get { throw null; } }
Expand Down
1 change: 0 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public HttpMessage(Azure.Core.Request request, Azure.Core.ResponseClassifier res
public bool BufferResponse { get { throw null; } set { } }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public bool HasResponse { get { throw null; } }
public System.TimeSpan? NetworkTimeout { get { throw null; } set { } }
public Azure.Core.Request Request { get { throw null; } }
public Azure.Response Response { get { throw null; } set { } }
public Azure.Core.ResponseClassifier ResponseClassifier { get { throw null; } }
Expand Down
1 change: 0 additions & 1 deletion sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ public HttpMessage(Azure.Core.Request request, Azure.Core.ResponseClassifier res
public bool BufferResponse { get { throw null; } set { } }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public bool HasResponse { get { throw null; } }
public System.TimeSpan? NetworkTimeout { get { throw null; } set { } }
public Azure.Core.Request Request { get { throw null; } }
public Azure.Response Response { get { throw null; } set { } }
public Azure.Core.ResponseClassifier ResponseClassifier { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/Azure.Core/src/HttpMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Response Response
/// Gets or sets the network timeout value for this message. If <c>null</c> the value provided in <see cref="RetryOptions.NetworkTimeout"/> would be used instead.
/// Defaults to <c>null</c>.
/// </summary>
public TimeSpan? NetworkTimeout { get; set; }
internal TimeSpan? NetworkTimeout { get; set; }

/// <summary>
/// Gets a property that modifies the pipeline behavior. Please refer to individual policies documentation on what properties it supports.
Expand Down
9 changes: 5 additions & 4 deletions sdk/monitor/Azure.Monitor.Query/src/LogsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ private async Task<Response<LogsQueryResult>> ExecuteAsync(string workspaceId, s
QueryBody queryBody = CreateQueryBody(query, timeRange, options, out string prefer);
using var message = _queryClient.CreateExecuteRequest(workspaceId, queryBody, prefer);

if (options?.Timeout != null)
{
message.NetworkTimeout = options.Timeout;
}
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/20859
// if (options?.Timeout != null)
// {
// message.NetworkTimeout = options.Timeout;
// }

if (async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ public class LogsQueryClientClientTests
public void CanSetServiceTimeout_Mocked()
{
string preferHeader = null;
TimeSpan? networkOverride = default;
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/20859
// TimeSpan? networkOverride = default;

var mockTransport = MockTransport.FromMessageCallback(message =>
{
Assert.True(message.Request.Headers.TryGetValue("prefer", out preferHeader));
networkOverride = message.NetworkTimeout;
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/20859
//networkOverride = message.NetworkTimeout;

return new MockResponse(500);
});
Expand All @@ -34,7 +36,8 @@ public void CanSetServiceTimeout_Mocked()
}));

Assert.AreEqual("wait=600", preferHeader);
Assert.AreEqual(TimeSpan.FromMinutes(10), networkOverride);
// TODO: https://github.com/Azure/azure-sdk-for-net/issues/20859
//Assert.AreEqual(TimeSpan.FromMinutes(10), networkOverride);
}
}
}

0 comments on commit 21f1f09

Please sign in to comment.