puppeteer-sharp
puppeteer-sharp copied to clipboard
Deadlocking after reconnect
Hi all,
I got issue when reconnecting browser. I will call it's deadlock because it doesn't throw any exception, it's stucking.
All of my code are async call
`public async Task ConnectPupperteer(CancellationToken cancellationToken) { await DisconnectPupperteer();
using var wsResponse = await _localClient.GetAsync($"http://{DebuggerAddress}/json/version", cancellationToken);
var wsContent = await wsResponse.Content.ReadAsStringAsync(cancellationToken);
var wsAddress = wsContent.Get("webSocketDebuggerUrl");
var browser = await Puppeteer.ConnectAsync(new()
{
BrowserWSEndpoint = wsAddress,
ProtocolTimeout = 10000,
});
var pages = await browser.PagesAsync();
var page = pages.First(p => p.MainFrame != null);
_browser = browser;
_page = page;
}`
I have no idea on this... anyone faced with this issue? Can you share?
Thank you for creating this library!
That's quite weird. We use ConfigureAwait(false) across the board, in fact, we have a rule enforcing that.
If you have an example please share it.
It's hard to give you an advice without an example.
@kblok do you have any idea for this, sir?
Could you try with async disposal instead of Dispose()?
Closed due to inactivity. Feel free to reopen it if needed.