Skip to content

Commit 94f8767

Browse files
committed
update version to 3.0; change WarmUp to read stream asynchronously; disable proxy tests; temporarily update xdt to work with preview extension
1 parent 8919c9e commit 94f8767

File tree

15 files changed

+60
-42
lines changed

15 files changed

+60
-42
lines changed

build.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ function BuildOutput([string] $runtime) {
165165
dotnet publish .\src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o "$privateSiteExtensionPath" -v q /p:BuildNumber=$buildNumber /p:IsPackable=false -c Release
166166

167167
# replace IL dlls with crossgen dlls
168-
if (![string]::IsNullOrEmpty($runtime)) {
169-
CrossGen $runtime $publishTarget $privateSiteExtensionPath
170-
}
168+
# TODO: Re-add this.
169+
#if (![string]::IsNullOrEmpty($runtime)) {
170+
# CrossGen $runtime $publishTarget $privateSiteExtensionPath
171+
#}
171172
}
172173

173174

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<LangVersion>7.2</LangVersion>
66
<RuntimeReleaseSuffix></RuntimeReleaseSuffix>
77
<BuildNumber Condition=" '$(BuildNumber)' == '' ">1</BuildNumber>
8-
<MajorMinorProductVersion>2.0</MajorMinorProductVersion>
8+
<MajorMinorProductVersion>3.0</MajorMinorProductVersion>
99
<Version>$(MajorMinorProductVersion).0$(RuntimeReleaseSuffix)$(VersionSuffix)</Version>
1010
<AssemblyVersion>$(MajorMinorProductVersion).0.0</AssemblyVersion>
1111
<FileVersion>$(MajorMinorProductVersion).$(BuildNumber).0</FileVersion>

src/WebJobs.Script.WebHost/Diagnostics/AzureMonitorDiagnosticLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics
1111
{
1212
public class AzureMonitorDiagnosticLogger : ILogger
1313
{
14-
internal const string AzureMonitorCategoryName = "FunctionExecutionLogs";
14+
internal const string AzureMonitorCategoryName = "FunctionAppLogs";
1515
internal const string AzureMonitorOperationName = "Microsoft.Web/sites/functions/execution";
1616

1717
private readonly string _hostVersion = ScriptHost.Version;

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,12 @@ public CustomHttpHeadersMiddleware(IOptions<CustomHttpHeadersOptions> hostOption
2121

2222
public async Task Invoke(HttpContext context, RequestDelegate next)
2323
{
24-
context.Response.OnStarting(() =>
25-
{
26-
foreach (var header in _hostOptions)
27-
{
28-
context.Response.Headers.TryAdd(header.Key, header.Value);
29-
}
30-
31-
return Task.CompletedTask;
32-
});
33-
3424
await next(context);
25+
26+
foreach (var header in _hostOptions)
27+
{
28+
context.Response.Headers.TryAdd(header.Key, header.Value);
29+
}
3530
}
3631
}
37-
}
32+
}

src/WebJobs.Script.WebHost/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args = null)
4040
.ConfigureKestrel(o =>
4141
{
4242
o.Limits.MaxRequestBodySize = 104857600;
43+
44+
// TODO: https://github.com/Azure/azure-functions-host/issues/4876
45+
o.AllowSynchronousIO = true;
4346
})
4447
.UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable(EnvironmentSettingNames.EnvironmentNameKey))
4548
.ConfigureServices(services =>

src/WebJobs.Script.WebHost/Resources/Functions/WarmUp/run.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
1818

1919
string name = req.Query["name"];
2020

21-
string requestBody = new StreamReader(req.Body).ReadToEnd();
21+
string requestBody = await (new StreamReader(req.Body)).ReadToEndAsync();
2222
dynamic data = JsonConvert.DeserializeObject(requestBody);
2323
name = name ?? data?.name ?? "";
2424

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
33
<system.webServer>
4-
<aspNetCore processPath="%PROGRAMFILES(X86)%\dotnet\dotnet.exe" arguments=".\Microsoft.Azure.WebJobs.Script.WebHost.dll" stdoutLogEnabled="false" hostingModel="inprocess" startupTimeLimit="3600" xdt:Transform="Replace" />
4+
<!-- TODO: Revert -->
5+
<!--<aspNetCore processPath="%PROGRAMFILES(X86)%\dotnet\dotnet.exe" arguments=".\Microsoft.Azure.WebJobs.Script.WebHost.dll" stdoutLogEnabled="false" hostingModel="inprocess" startupTimeLimit="3600" xdt:Transform="Replace" />-->
6+
<aspNetCore processPath="%DOTNET_ROOT%\dotnet.exe" arguments=".\Microsoft.Azure.WebJobs.Script.WebHost.dll" stdoutLogEnabled="false" hostingModel="inprocess" startupTimeLimit="3600" xdt:Transform="Replace" />
57
</system.webServer>
68
</configuration>

src/WebJobs.Script/OutOfProc/Rpc/RpcInitializationService.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,19 @@ public async Task StartAsync(CancellationToken cancellationToken)
6969
{
7070
return;
7171
}
72-
_logger.LogDebug("Starting Rpc Initialization Service.");
73-
await InitializeRpcServerAsync();
74-
await InitializeChannelsAsync();
75-
_logger.LogDebug("Rpc Initialization Service started.");
72+
73+
// TODO: https://github.com/Azure/azure-functions-host/issues/4891
74+
try
75+
{
76+
_logger.LogDebug("Starting Rpc Initialization Service.");
77+
await InitializeRpcServerAsync();
78+
await InitializeChannelsAsync();
79+
_logger.LogDebug("Rpc Initialization Service started.");
80+
}
81+
catch (Exception ex)
82+
{
83+
_logger.LogError(ex, "Error starting Rpc Initialization Service. Handling error and continuing.");
84+
}
7685
}
7786

7887
public async Task StopAsync(CancellationToken cancellationToken)

test/WebJobs.Script.Tests.Integration/Controllers/ControllerScenarioTestFixture.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public virtual async Task InitializeAsync()
7676
.ConfigureAppConfiguration(c => c.AddEnvironmentVariables());
7777

7878
ConfigureWebHostBuilder(webHostBuilder);
79-
80-
HttpServer = new TestServer(webHostBuilder);
79+
80+
// TODO: https://github.com/Azure/azure-functions-host/issues/4876
81+
HttpServer = new TestServer(webHostBuilder) { AllowSynchronousIO = true };
8182

8283
HttpClient = HttpServer.CreateClient();
8384
HttpClient.BaseAddress = new Uri("https://localhost/");

test/WebJobs.Script.Tests.Integration/Host/StandbyManager/StandbyInitializationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public async Task IsPlaceholderMode_ThroughoutInitialization_EvaluatesCorrectly(
8181
});
8282
});
8383

84-
var server = new TestServer(builder);
84+
// TODO: https://github.com/Azure/azure-functions-host/issues/4876
85+
var server = new TestServer(builder) { AllowSynchronousIO = true };
8586
var client = server.CreateClient();
8687

8788
// Force the specialization middleware to run

0 commit comments

Comments
 (0)