Commit Graph

1532 Commits

Author SHA1 Message Date
lorry li
ca191e4c9d Use the same cvar CVarHttpEventLoopEnableChance to enable event loop by default on apple http impl;
Moved the code to HttpManager to get rid of the duplicated code.

[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb michael.atchison, Michael.Kirzinger, Rafa.Lecina

[CL 32128159 by lorry li in ue5-main branch]
2024-03-08 14:36:52 -05:00
stephen ma
d0f72fa566 Allow '.' in FHttpPath validation in HttpServer's implementation.
#rb Mitchell.Fisher

[CL 32121614 by stephen ma in ue5-main branch]
2024-03-08 11:17:47 -05:00
lorry li
d15a747d00 Enable event loop by default on most of the platforms.
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb michael.atchison, Michael.Kirzinger
#tests Passed WebTests on Windows

[CL 32118356 by lorry li in ue5-main branch]
2024-03-08 09:40:30 -05:00
lorry li
9f7b96d4f7 When http request total timeout during lockout, make sure it can trigger complete delegate by http delegate thread policy;
Use FTSTicker in http manager instead to manage game thread tasks.

#jira UE-163631
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb Rafa.Lecina
#tests Passed all tests in WebTests project

[CL 32052075 by lorry li in ue5-main branch]
2024-03-06 09:41:35 -05:00
lorry li
efdbf20e85 Make sure to stop activity timeout timer when total timeout triggered;
Only output log if request had completed when activity timeout, it can continue to run even if that happened.

[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina
#rb Rafa.Lecina

[CL 31948912 by lorry li in ue5-main branch]
2024-03-01 13:19:35 -05:00
lorry li
fc4c5d6b53 Add more comments to http complete callback;
Format the indents in IHttpRequest.h.

[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina

#rb Michael.Kirzinger, Rafa.Lecina

[CL 31943658 by lorry li in ue5-main branch]
2024-03-01 10:17:44 -05:00
lorry li
6a2c4113e8 Fix the random failure in test case "Retry manager and http manager is thread safe for flushing".
Reason:
When FHttpManager::Tick get called from different threads, it might get same request in CompletedThreadedRequests through the http thread, because Thread->GetCompletedRequests is not thread safe. In the end it will crash due to access destroyed CompletedRequest.

[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina
#rb michael.atchison, Michael.Kirzinger

[CL 31885410 by lorry li in ue5-main branch]
2024-02-28 16:28:10 -05:00
lorry li
1d79a2d847 Fix the test case "Optionally retry limit can be set differently for connection error" by using latest expected back off value;
Make the test case "Test platform request requests limits" covers the cancelling using CompleteOnHttpThread as delegate thread policy.

[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina [at]stephen.ma
#rb Rafa.Lecina
#tests Passed the WebTests.

[CL 31879765 by lorry li in ue5-main branch]
2024-02-28 14:33:34 -05:00
lorry li
1470d52971 Fix the http issue that FinishRequest could potentially be called twice in CurlHttp impl.
Reason: When FHttpRequestCommon::CancelRequest get called, it will set bCanceled as true and abort request which will in the end call FinishRequest. But in http thread it will also check IsThreadedRequestComplete to see if the request is complete and call FinishRequest, in that function we shouldn't check bCanceled or bTimedOut, because request has already been aborted when those flags changed.

[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina [at]jens.petersam
#jira UE-206965
#rb Michael.Kirzinger, Rafa.Lecina
#tests Reproduced and fixed with a test case

[CL 31858760 by lorry li in ue5-main branch]
2024-02-27 19:20:09 -05:00
rafa lecina
9a1727db2d Fixed issues in AppleHttp so WebTests "Retry immediately without lock out if connect failed and there are alt domains" and "Make sure connection time out can work well for 2nd same http request" are passed
Also fixed a wrong unconditional cast in case of non http response

#jira UE-207067
[REVIEW] [at]lorry.li [at]michael.kirzinger [at]michael.atchison
#rb lorry.li, michael.atchison


#changelist validated
#virtualized

[CL 31844753 by rafa lecina in ue5-main branch]
2024-02-27 13:11:33 -05:00
rafa lecina
c822e9dfc0 In Apple http impl change it to read response headers once received status code;
Use cvar for the new flow just in case the headers needs to be read when complete for some urls

#jira UE-203938
[REVIEW] [at]Lorry.Li [at]Michael.Kirzinger [at]Michael.Atchison
#rb lorry.li, michael.atchison, Sam.Zamani

[CL 31843775 by rafa lecina in ue5-main branch]
2024-02-27 12:26:46 -05:00
lorry li
8ba25ae194 Fix the compile error in AppleHttp caused by bCanceled.
[CL 31821464 by lorry li in ue5-main branch]
2024-02-26 18:17:51 -05:00
lorry li
fa91b21b64 Fix the dead lock by reducing the scope of request lock in http manager to make sure when trigger http request complete callback in Tick, it doesn't hold the requests lock;
Deperecate the FGenericPlatformHttp::UsesThreadedHttp interface and remove corresponding impls, now all platforms are using threaded http requests;
Re-enable retry system off-game thread support.

Reason:
When accessing requests lock and trigger complete callback in http manager Tick from main thread, the complete callback could have been bound to retry manager which will try to access retry manager lock, while retry manager lock can be holding by FHttpRetrySystem::FManager::RetryHttpRequestWithDelay, which triggered by timer callback from http thread and is trying to access http manager's requests lock in order to add the retry request to http manager.

[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina
#rb michael.atchison

[CL 31821069 by lorry li in ue5-main branch]
2024-02-26 18:12:55 -05:00
lorry li
0cd2b1ff8d Make sure don't pass received data to stream interface after cancelling the http request or after shutdowning http module;
Add test cases to test that after canceling/shut down request, the response body receive delegate won't ever been called.

[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina [at]jens.petersam
#jira UE-207423, FORT-706402
#rb michael.atchison, Rafa.Lecina

[CL 31820574 by lorry li in ue5-main branch]
2024-02-26 18:06:19 -05:00
lorry li
3019b9090b Adjust the max concurrent http requests, make it hotfixable.
[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]ryan.hairyes [at]chris.varnsverry [at]laura.hermanns [at]alejandro.aguilar
#rb Chris.Varnsverry, Laura.Hermanns, michael.atchison

[CL 31817974 by lorry li in ue5-main branch]
2024-02-26 16:50:00 -05:00
lorry li
3cc8ac9972 Make it not output warning when connection timeout equals activity timeout.
#jira UE-208112
[REVIEW] [at]michael.atchison [at]rafa.lecina [at]michael.kirzinger
#rb michael.atchison

[CL 31814179 by lorry li in ue5-main branch]
2024-02-26 15:15:45 -05:00
lorry li
0d51ce6853 Fix the test case "Optionally retry limit can be set differently for connection error", can't really retry when activity timeout, because the response is not null when get connection error. User code might still want to access the response when activity timeout. So changed the test case to use connection time out instead;
Get rid of platform specific code in WebTests, define macros in Http.Build.cs instead.

[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#jira UE-207067, UE-207061
#rb Rafa.Lecina

[CL 31777105 by lorry li in ue5-main branch]
2024-02-23 16:26:05 -05:00
lorry li
67a08f1634 Improve default HTTP retry behavior when services do not indicate how long to wait for retries
- Retry period changed from linear to exponential;
- Adds random jitter multiplication to computed backoff.

Final default retry lockout period formula looks like this:
RandRange(JitterMin, JitterMax) * Pow(Base, RetryNumber + 1 + Bias) where RetryNumber is 0, 1, 2, 3...

Defaults:
JitterMin = 0.5
JitterMax = 1.0
Base = 2.0
Bias = 1.0

[REVIEW] [at]david.parton [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb Rafa.Lecina

[CL 31776593 by lorry li in ue5-main branch]
2024-02-23 16:17:01 -05:00
lorry li
6401069a66 Change the default connection timeout to 30s.
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]eric.day [at]rafa.lecina
#rb eric.day, michael.atchison, Rafa.Lecina

[CL 31774242 by lorry li in ue5-main branch]
2024-02-23 15:17:48 -05:00
lorry li
cf80c5572c Disable retry system off-game thread temporarily until the new found dead lock issue is fixed.
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina

[CL 31773568 by lorry li in ue5-main branch]
2024-02-23 15:05:09 -05:00
lorry li
e4db25bf24 Get rid of the legacy http flush in websockets when suspend.
[REVIEW] [at]michael.atchison [at]michael.kirzinger [at]rafa.lecina [at]evgenii.babinets
#rb michael.atchison

[CL 31700324 by lorry li in ue5-main branch]
2024-02-21 17:41:38 -05:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
lorry li
c6292b58db Don't output warning when timed out if the request is in completed state.
[REVIEW] [at]chris.adams [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb Michael.Kirzinger

[CL 31624018 by lorry li in ue5-main branch]
2024-02-19 16:03:26 -05:00
lorry li
484f577b64 Refactor: Split big function ProcessRequest into small functions in HttpThreadBase.
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina [at]alejandro.aguilar
#rb alejandro.aguilar, michael.atchison

[CL 31529725 by lorry li in ue5-main branch]
2024-02-15 14:36:20 -05:00
lorry li
f793c875f2 Extract the Response from http request implementions into HttpRequestCommon;
Fix the test case the response in request is not cleared on some platforms when retrying.

#jira UE-202804
[REVIEW] [at]michael.kirzinger [at]michael.atchison [at]rafa.lecina
#rb michael.atchison, Rafa.Lecina

[CL 31518978 by lorry li in ue5-main branch]
2024-02-15 09:54:57 -05:00