Azure / Azure/azure-functions-host

[LanguageWorkers]Implement function reload

Open
#3,400 7 comments 2 reactions 0 assignees View on GitHub
feature:language-extensibility
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

We are too aggressive about restarting the language worker processes (for example, on re-loading user code). Can lead to confusing log messages about `node exited with code -1`

-----
First reported: https://github.com/Azure/azure-functions-core-tools/issues/689
_Per @blueelvis:_
Hi!

Host Version - `2.0.12050.0`
Running I am starting the function and after starting, I get the following in the logs -

```
[02-09-2018 13:43:04] Generating 4 job function(s)
[02-09-2018 13:43:04] Found the following functions:
[02-09-2018 13:43:04] Host.Functions.damage-assessment-bot
[02-09-2018 13:43:04] Host.Functions.messages
[02-09-2018 13:43:04] Host.Functions.some-function
[02-09-2018 13:43:04] Host.Functions.test
[02-09-2018 13:43:04]
[02-09-2018 13:43:04] Host initialized (86ms)
[02-09-2018 13:43:04] Host started (88ms)
[02-09-2018 13:43:04] Job host started
[02-09-2018 13:43:04] Stopping JobHost
[02-09-2018 13:43:04] Job host stopped
info: Host.General[0]
Script host restarted.
[02-09-2018 13:43:04] Language Worker Process exited.
[02-09-2018 13:43:04] node exited with code -1
.
[02-09-2018 13:43:04] Worker 6cdf2495-5568-40ee-ac26-a973a2423e99 connecting on 127.0.0.1:22499 []
[02-09-2018 13:43:05] Path must be a string. Received undefined
[02-09-2018 13:43:09] Host lock lease acquired by instance ID '000000000000000000000000571B63F6'.
```

The Function starts working fine but any idea why am I getting that the job host was stopped and node exited with code -1?

Contributor guide

Open the contributing guide

Research direction

Start by tracing the LanguageWorkers behavior during user-code reloads and compare it with the restart and log sequence described in the issue and linked report. Done means function reload no longer unnecessarily restarts language workers or produces misleading process-exit messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.