Skip to content

Commit cc189e9

Browse files
authored
[V3]Disable NoGC during cold start for Linux Consumption. (#8713)
* Disable NoGCRegion on Linux consumption. (#8687) (#8688) * [V3]Disable NoGC during cold start for Linux Consumption.
1 parent 173742c commit cc189e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<LangVersion>latest</LangVersion>
66
<MajorVersion>3</MajorVersion>
77
<MinorVersion>14</MinorVersion>
8-
<PatchVersion>0</PatchVersion>
8+
<PatchVersion>1</PatchVersion>
99
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
1010
<Version Condition=" '$(BuildNumber)' != '' ">$(VersionPrefix)-$(BuildNumber)</Version>
1111
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ClrOptimizationMiddleware(RequestDelegate next, IScriptWebHostEnvironment
3131
_environment = environment;
3232
_logger = logger;
3333
_next = next;
34-
_invoke = InvokeClrOptimizationCheck;
34+
_invoke = _environment.IsLinuxConsumption() ? next : InvokeClrOptimizationCheck;
3535
}
3636

3737
public Task Invoke(HttpContext context)
@@ -56,7 +56,7 @@ private void StartStopGCAsBestEffort()
5656
try
5757
{
5858
// optimization not intended for single core VMs
59-
if (_webHostEnvironment.InStandbyMode && _environment.GetEffectiveCoresCount() > 1)
59+
if (_webHostEnvironment.InStandbyMode && _environment.GetEffectiveCoresCount() > 1 && !_environment.IsLinuxConsumption())
6060
{
6161
// If in placeholder mode and already in NoGCRegion, let's end it then start NoGCRegion again.
6262
// This may happen if there are multiple warmup calls(few minutes apart) during placeholder mode and before specialization.

0 commit comments

Comments
 (0)