[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1314 #1869 Default timeout enhancements #2073

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8ed9057
RequestTimeoutSeconds FileGlobalConfiguration
hogwartsdeveloper May 25, 2024
138dc7b
Fix Test
hogwartsdeveloper May 25, 2024
9bcb23d
Fix Remarks
hogwartsdeveloper May 26, 2024
7ab3672
Add DI FileGlobalConfiguration. PollyQoSProvider, PollyQoSResilienceP…
hogwartsdeveloper May 27, 2024
0eb8d73
Fix Remarks
hogwartsdeveloper May 28, 2024
bf24893
Fix remarks
hogwartsdeveloper May 28, 2024
97407d0
Add DownStream Timeout
hogwartsdeveloper May 29, 2024
f6da820
Use One Timeout
hogwartsdeveloper May 29, 2024
dd150f7
Fix
hogwartsdeveloper May 29, 2024
e914ca6
Fix Remarks
hogwartsdeveloper May 29, 2024
ebe7176
Nullable timeouts
hogwartsdeveloper May 30, 2024
24f2260
Remove TimeoutCreator
hogwartsdeveloper May 30, 2024
e94ab50
RoutesCreator CreateTimeout
hogwartsdeveloper May 30, 2024
602d871
PollyQoSResiliencePipelineProvider Return Old Logic And if-condition
hogwartsdeveloper May 30, 2024
aefa309
Fix
hogwartsdeveloper May 30, 2024
249732e
Fix Remarks
hogwartsdeveloper Jun 1, 2024
6d9a796
Fix remarks
hogwartsdeveloper Jun 2, 2024
68b88a8
Fix
hogwartsdeveloper Jun 2, 2024
65c78a2
Fix Tests
hogwartsdeveloper Jun 2, 2024
aaa3e3f
Update src/Ocelot/Configuration/File/FileRoute.cs
hogwartsdeveloper Jun 1, 2024
3ce5151
Fix build error
hogwartsdeveloper Jun 2, 2024
8b51284
Fix warnings: SA1108 SA1629 SA1518
raman-m Jun 3, 2024
d78bd9e
Fix SA1108 warning
raman-m Jun 3, 2024
d98c971
Try to fix... failed
raman-m Jun 3, 2024
490f55e
Fix Tests
hogwartsdeveloper Jun 4, 2024
68e517a
MessageInvokerPoolTests
hogwartsdeveloper Jun 4, 2024
c9bdec2
RoutesCreatorTests
hogwartsdeveloper Jun 4, 2024
c457a31
Review fixed/new unit tests
raman-m Jun 4, 2024
69a197a
Remove BDDfy from unit tests
raman-m Jun 4, 2024
2e35a20
Review `MessageInvokerPoolTests` and AAA pattern
raman-m Jun 4, 2024
2a688da
Fix test : `Should_timeout_per_default_after_90_seconds`
raman-m Jun 4, 2024
4d6e72d
More refactoring: QoS vs DynRoute timeouts
raman-m Jun 4, 2024
ef44dcc
Polly constraints
raman-m Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Remarks
  • Loading branch information
hogwartsdeveloper authored and raman-m committed Jun 12, 2024
commit e914ca6ec6b13e98caf6df47e8bcfb2594fa5117
2 changes: 1 addition & 1 deletion src/Ocelot/Configuration/Creator/TimeoutCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public int Create(FileRoute fileRoute, FileGlobalConfiguration globalConfigurati
{
return fileRoute.Timeout > 0
? fileRoute.Timeout
: (globalConfiguration.RequestTimeoutSeconds ?? 0) * 1000;
: globalConfiguration.RequestTimeoutSeconds * 1000;
}
}
}
3 changes: 2 additions & 1 deletion src/Ocelot/Configuration/File/FileGlobalConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ public FileGlobalConfiguration()
HttpHandlerOptions = new FileHttpHandlerOptions();
CacheOptions = new FileCacheOptions();
MetadataOptions = new FileMetadataOptions();
RequestTimeoutSeconds = 90;
}

public string RequestIdKey { get; set; }

public int? RequestTimeoutSeconds { get; set; }
public int RequestTimeoutSeconds { get; set; }
raman-m marked this conversation as resolved.
Show resolved Hide resolved

public FileServiceDiscoveryProvider ServiceDiscoveryProvider { get; set; }

Expand Down
14 changes: 1 addition & 13 deletions src/Ocelot/Requester/MessageInvokerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ public HttpMessageInvoker Get(DownstreamRoute downstreamRoute)
}

public void Clear() => _handlersPool.Clear();

public const int DefaultRequestTimeoutSeconds = 90;

private int _requestTimeoutSeconds;

public int RequestTimeoutSeconds
{
get => _requestTimeoutSeconds > 0 ? _requestTimeoutSeconds : DefaultRequestTimeoutSeconds;
set => _requestTimeoutSeconds = value > 0 ? value : DefaultRequestTimeoutSeconds;
}

private HttpMessageInvoker CreateMessageInvoker(DownstreamRoute downstreamRoute)
{
Expand All @@ -60,9 +50,7 @@ private HttpMessageInvoker CreateMessageInvoker(DownstreamRoute downstreamRoute)
// It's standard behavior to throw TimeoutException after the defined timeout (90 seconds by default)
var timeoutHandler = new TimeoutDelegatingHandler(downstreamRoute.QosOptions.TimeoutValue > 0
raman-m marked this conversation as resolved.
Show resolved Hide resolved
? TimeSpan.FromMilliseconds(downstreamRoute.QosOptions.TimeoutValue)
: downstreamRoute.Timeout > 0
? TimeSpan.FromMilliseconds(downstreamRoute.Timeout)
: TimeSpan.FromSeconds(RequestTimeoutSeconds))
: TimeSpan.FromMilliseconds(downstreamRoute.Timeout))
{
InnerHandler = baseHandler,
};
Expand Down