Azure / Azure/azure-functions-host

Language worker "User" logs are ignored after execution is complete

Open
#8,222 5 comments 0 reactions 0 assignees View on GitHub
bug design feature:language-extensibility
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

Back when @yojagad added a `LogCategory` for language workers to pass either `System` or `User` in [this PR](https://github.com/Azure/azure-functions-nodejs-worker/pull/239) to the node worker, @pragnagopa said

> With in the execution context, we should not be logging system logs

However, some of the logs in question are like this:

> Error: 'done' has already been called. Please check your script for extraneous calls to 'done'.

Which actually happens _after_ execution completes. As of today, those logs are silently ignored by the host [here](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs#L727) (nothing in app insights, nothing in the console, etc.). Which leads me to a few questions:
- What exactly is the difference between `System` and `User` logs? (We might want to document in the protobuf definition)
- How should language workers categorize logs that are _related_ to an execution, but _after_ an execution?
- Should the host really be ignoring these logs? These logs could be coming directly from the user, and perhaps they don't realize they log after execution completes because they never see the logs.

cc @alrod

Contributor guide

Open the contributing guide

Research direction

Start at src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs around line 727 and inspect how System and User LogCategory values are handled after execution completes. Review the protobuf definition mentioned in the issue, then determine the agreed behavior for execution-related logs emitted afterward; done requires a decided categorization or host-handling change, with its behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.