question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Defunct process issue under latest version

See original GitHub issue

[Using puppeteer-sharp under asp.net .net core 2.2 keeps defunct chrome processes when Puppeteer object is disposed]

Steps to reproduce:

  1. Install asp.net core 2.2 api
  2. With simple request call puppeteer, lunch browser, get content close browser
  3. Observe a lot of defunct processes
  4. Sooner or later observer Docker: “No space left on device”
 using (var browser = await Puppeteer.LaunchAsync(options).ConfigureAwait(false))
  {
                var allPages = await browser.PagesAsync().ConfigureAwait(false);
                var page = allPages.First();

                try
                {
                    await page.SetBypassCSPAsync(true);
                    await page.SetRequestInterceptionAsync(true).ConfigureAwait(false);

                    DisableMediaContent(page);

                   // navigation to page omitted here
                }
}

image

What I am doing wrong? Any recommendations are much appreciated. Thank you in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kblokcommented, Mar 11, 2019

I ran into some issues when running Puppeteer-Sharp on a machine with low resources. I did this:

_chromiumProcessID = browser.Process.Id;

public static void EnforceChromiumClose()
{
    var process = Process.GetProcessById(_chromiumProcessID);
    if (_chromiumProcessID > 0 && process?.HasExited == false)
    {
        process.Kill();
    }
}

Not clean at all. But if Chromium can’t gracefully close itself. I would force kill it.

1reaction
mesanjacommented, Mar 20, 2019

It’s turned out that issue is not related to puppeteer it self but for docker nature. In order to wipe zombies I used this solution https://github.com/Yelp/dumb-init. For anyone who faced with same issue, please use dumb-init.

Thanks all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a <defunct> process, and why doesn't it get killed?
From your output we see a "defunct", which means the process has either completed its task or has been corrupted or killed, but...
Read more >
Defunct processes on AIX
A defunct process, also known as a zombie, is simply a process that is no longer running, but remains in the process table...
Read more >
Processes in a Zombie (Z) or Defunct State | Support
Defunct ("zombie") processes are child processes that have terminated, but have not been reaped by the parent. See ps(1). If a parent process ......
Read more >
How to identify and kill zombie/defunct processes in Linux ...
When a process dies on Linux, it isn't all removed from memory immediately its process descriptor stays in memory. The process status becomes ......
Read more >
Problem Killing Defunct Process - Operating Systems
Sometimes, (usually due to bad programming) process stay in "defunct", this means that the process doesn't exist anymore, but there is still an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found