Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log when FunctionDispatcher is initialized. #6230

Merged
merged 2 commits into from Jun 17, 2020
Merged

Conversation

pragnagopa
Copy link
Member

Fixes #4384

@pragnagopa
Copy link
Member Author

pragnagopa commented Jun 17, 2020

cc @EricJizbaMSFT

verrfied debugger breaks into a js function with runonstartup set to true for the first invocation with following tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "func",
      "command": "host start",
      "isBackground": true,
      "dependsOn": "npm install",
       "problemMatcher": {
        "base": "$func-watch",
        "background": {
          "activeOnStart": true,
          "beginsPattern": "^.*(Job host stopped|signaling restart).*$",
          "endsPattern": "^.*Worker process started and initialized.*$"
        },
       }
    },
    {
      "type": "shell",
      "label": "npm install",
      "command": "npm install"
    },
    {
      "type": "shell",
      "label": "npm prune",
      "command": "npm prune --production",
      "problemMatcher": []
    }
  ]
}

@@ -65,15 +65,14 @@ internal class HttpFunctionInvocationDispatcher : IFunctionInvocationDispatcher

internal Task InitializeHttpWorkerChannelAsync(int attemptCount, CancellationToken cancellationToken = default)
{
// TODO: Add process managment for http invoker

_httpWorkerChannel = _httpWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _metricsLogger, attemptCount);
_httpWorkerChannel.StartWorkerProcessAsync(cancellationToken).ContinueWith(workerInitTask =>
{
if (workerInitTask.IsCompleted)
{
_logger.LogDebug("Adding http worker channel. workerId:{id}", _httpWorkerChannel.Id);
State = FunctionInvocationDispatcherState.Initialized;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove this line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm...deleted commented lines. No new line here.

Hazhzeng
Hazhzeng previously approved these changes Jun 17, 2020
Copy link
Contributor

@Hazhzeng Hazhzeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Copy link
Contributor

@mhoeger mhoeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ looks great - thanks!!

@pragnagopa pragnagopa merged commit edeb2a5 into dev Jun 17, 2020
@pragnagopa pragnagopa deleted the pgopa/addDebugLog branch June 17, 2020 23:02
@TroyWitthoeft
Copy link

TroyWitthoeft commented Jul 9, 2020

We're currently getting bit by this bug #4384 in production. We have a python http trigger on consumption plan intermittently failing with: Did not find any initialized language workers

"Anxiously awaiting this fix! 💪 Status? Where can I track if our our Azure environment gets the latest bits?"
Nevermind, found it. Application Insights (Kusto) has got the sdkversion column which correlate to the release tags.
I can confirm that we are only seeing this error on older versions, such as 3.0.13901.0 Runs on the latest version are healthy.
Thanks all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add log to signify when debugger can attach
4 participants