Skip to content

Commit 6d4f732

Browse files
authored
Adjusting the logic to determine the warmup call in placeholder simulation mode to align with the prod (#10918)
* Placeholder simulation mode should trigger warmup code path using /api/warmup call to execute the Invocation middleware flow. * Add release notes.
1 parent 5f7ac2f commit 6d4f732

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

eng/ci/templates/official/jobs/run-coldstart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
displayName: Start host in placeholder mode
125125
126126
- pwsh: |
127-
$url = "http://localhost:5000" # In placeholder simulation mode, calling homepage triggers warmup.
127+
$url = "http://localhost:5000/api/warmup?restart=1"
128128
Write-Host "Checking if host is ready at $url..."
129129
$maxAttempts = 10
130130

release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
- Add support for new FeatureFlag `EnableAzureMonitorTimeIsoFormat` to enable iso time format for azmon logs for Linux Dedicated/EP Skus. (#10684)
99
- Allow sync trigger to happen in managed environment when `AzureWebJobsStorage` is not set (#10767)
1010
- Fixing default DateTime bug with TimeZones in TimerTrigger (#10906)
11+
- Adjusting the logic to determine the warmup call in placeholder simulation mode to align with the production flow (#10918)

src/WebJobs.Script.WebHost/Middleware/HostWarmupMiddleware.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ public async Task HostWarmupAsync(HttpRequest request)
167167

168168
public static bool IsWarmUpRequest(HttpRequest request, bool inStandbyMode, IEnvironment environment)
169169
{
170-
// In placeholder simulation mode, we want the homepage request to also trigger warmup code.
171-
var isWarmupViaHomePageRequest = Utility.IsInPlaceholderSimulationMode && inStandbyMode && request.Path.Value == "/";
172-
if (isWarmupViaHomePageRequest)
170+
// Check if the request is a warmup request in placeholder simulation mode
171+
if (Utility.IsInPlaceholderSimulationMode && inStandbyMode &&
172+
(request.Path.StartsWithSegments(_warmupRoutePath, StringComparison.OrdinalIgnoreCase) || request.Path.StartsWithSegments(_warmupRouteAlternatePath, StringComparison.OrdinalIgnoreCase)))
173173
{
174174
return true;
175175
}

0 commit comments

Comments
 (0)