Skip to content

Commit 45624d1

Browse files
authored
Hotfix 4.8.1-Fix for dotnet-isolated function app debugging hang issue (#8599)
* Fix for dotnet-isolated function app debugging hang issue (#8596) * Deleted the code which removed the "azfuncjsonlog:" prefix for log messages meant for tooling as core tools rely on that prefix. * Test improvements * Added release notes * Bump version to 481 * Fixed release notes
1 parent efbb61c commit 45624d1

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
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>4</MajorVersion>
77
<MinorVersion>8</MinorVersion>
8-
<PatchVersion>0</PatchVersion>
8+
<PatchVersion>1</PatchVersion>
99
<BuildNumber Condition="'$(BuildNumber)' == '' ">0</BuildNumber>
1010
<PreviewVersion></PreviewVersion>
1111

release_notes.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22
<!-- Please add your release notes in the following format:
33
- My change description (#PR)
44
-->
5-
6-
- Updated Java Worker Version to [2.3.1](https://github.com/Azure/azure-functions-java-worker/releases/tag/2.3.1)
7-
8-
**Release sprint:** Sprint 123
9-
[ [bugs](https://github.com/Azure/azure-functions-host/issues?q=is%3Aissue+milestone%3A%22Functions+Sprint+123%22+label%3Abug+is%3Aclosed) | [features](https://github.com/Azure/azure-functions-host/issues?q=is%3Aissue+milestone%3A%22Functions+Sprint+123%22+label%3Afeature+is%3Aclosed) ]
5+
- Fix the bug where debugging of dotnet isolated function apps hangs in visual studio (#8596)

src/WebJobs.Script/Workers/ProcessManagement/WorkerProcessUtilities.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,5 @@ public static bool IsToolingConsoleJsonLogEntry(ConsoleLog consoleLog)
4343
{
4444
return consoleLog.Message.StartsWith(WorkerConstants.ToolingConsoleLogPrefix, StringComparison.OrdinalIgnoreCase);
4545
}
46-
47-
public static string RemoveToolingConsoleJsonLogPrefix(string msg)
48-
{
49-
return Regex.Replace(msg, WorkerConstants.ToolingConsoleLogPrefix, string.Empty, RegexOptions.IgnoreCase);
50-
}
5146
}
5247
}

src/WebJobs.Script/Workers/WorkerConsoleLogService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ internal async Task ProcessLogs()
6565

6666
if (WorkerProcessUtilities.IsToolingConsoleJsonLogEntry(consoleLog))
6767
{
68-
_toolingConsoleJsonLoggerLazy.Value.Log(consoleLog.Level,
69-
WorkerProcessUtilities.RemoveToolingConsoleJsonLogPrefix(consoleLog.Message));
68+
// log with the message prefix as coretools expects it.
69+
_toolingConsoleJsonLoggerLazy.Value.Log(consoleLog.Level, consoleLog.Message);
7070
}
7171
else
7272
{

test/WebJobs.Script.Tests/Workers/WorkerConsoleLogServiceTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task WorkerConsoleLogService_ConsoleLogs_LogLevel_Expected(bool use
5050
workerProcess.ParseErrorMessageAndLog("LanguageWorkerConsoleLog[Test Worker Message No keyword]");
5151
workerProcess.ParseErrorMessageAndLog("LanguageWorkerConsoleLog[Test Worker Error Message]");
5252
workerProcess.ParseErrorMessageAndLog("LanguageWorkerConsoleLog[Test Worker Warning Message]");
53-
workerProcess.ParseErrorMessageAndLog("azfuncjsonlog:Azure Functions .NET Worker (PID: 4) initialized in debug mode.");
53+
workerProcess.ParseErrorMessageAndLog("azfuncjsonlog:{ 'name':'dotnet-worker-startup', 'workerProcessId' : 321 }");
5454

5555
// Act
5656
_ = _workerConsoleLogService.ProcessLogs().ContinueWith(t => { });
@@ -73,22 +73,23 @@ public async Task WorkerConsoleLogService_ConsoleLogs_LogLevel_Expected(bool use
7373
{
7474
VerifyLogLevel(userLogs, "Test Message No keyword", LogLevel.Error);
7575
VerifyLogLevel(systemLogs, "[Test Worker Message No keyword]", LogLevel.Error);
76-
VerifyLogLevel(toolingConsoleLogs, "Azure Functions .NET Worker (PID: 4) initialized in debug mode.", LogLevel.Error);
76+
VerifyLogLevel(toolingConsoleLogs, "azfuncjsonlog:{ 'name':'dotnet-worker-startup', 'workerProcessId' : 321 }", LogLevel.Error);
7777
}
7878
else
7979
{
8080
VerifyLogLevel(userLogs, "Test Message No keyword", LogLevel.Information);
8181
VerifyLogLevel(systemLogs, "[Test Worker Message No keyword]", LogLevel.Information);
82-
VerifyLogLevel(toolingConsoleLogs, "Azure Functions .NET Worker (PID: 4) initialized in debug mode.", LogLevel.Information);
82+
VerifyLogLevel(toolingConsoleLogs, "azfuncjsonlog:{ 'name':'dotnet-worker-startup', 'workerProcessId' : 321 }", LogLevel.Information);
8383
}
84+
85+
Assert.True(toolingConsoleLogs.All(l => l.FormattedMessage.StartsWith(WorkerConstants.ToolingConsoleLogPrefix)));
8486
}
8587

8688
private static void VerifyLogLevel(IList<LogMessage> allLogs, string msg, LogLevel expectedLevel)
8789
{
8890
var message = allLogs.FirstOrDefault(l => l.FormattedMessage.Contains(msg));
8991
Assert.NotNull(message);
9092
Assert.DoesNotContain(WorkerConstants.LanguageWorkerConsoleLogPrefix, message.FormattedMessage);
91-
Assert.DoesNotContain(WorkerConstants.ToolingConsoleLogPrefix, message.FormattedMessage);
9293
Assert.Equal(expectedLevel, message.Level);
9394
}
9495
}

0 commit comments

Comments
 (0)