story2sketch icon indicating copy to clipboard operation
story2sketch copied to clipboard

Hangs and times out when processing more stories than concurrency

Open Peeja opened this issue 6 years ago • 6 comments
trafficstars

story2sketch started timing out as soon as I had more than 16 stories. Turns out that's the value it's computing for concurrency. If I set concurrency to 17, I can run 17 stories; if I set it to 15, I can only run 15.

It fails with TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded at node_modules/puppeteer/lib/LifecycleWatcher.js:142:21.

Peeja avatar Nov 19 '19 18:11 Peeja

Ah, it's failing at:

                return page.goto(builtUrl, {
                  waitUntil: "networkidle2"
                });

I don't know Puppeteer at all, but I gather networkidle2 never happens on my machine for some reason.

Peeja avatar Nov 19 '19 18:11 Peeja

I had the same issue, mine runs through all stories when I set concurrency to 2

SuneRadich avatar Nov 20 '19 07:11 SuneRadich

Huh, me too. 3 seems to work also.

I wonder if Puppeteer is looking at connections across all the window's tabs to determine when the network is idle?

Peeja avatar Nov 20 '19 16:11 Peeja

Hey @Peeja, thanks for reporting this. Can you confirm what version you're using?

This was supposed to be fixed in #71, but perhaps it didn't work as expected.

chrisvxd avatar Nov 26 '19 05:11 chrisvxd

@chrisvxd I'm on 1.7.0, so I should have that change. But I don't think it's related. That causes it to (correctly) default the concurrency to 16, but the issue here is that any time the concurrency (default or explicit) is smaller than the number of stories, it times out waiting for networkidle2.

If the concurrency is greater than or equal to the number of stories, each gets its own tab, and there's no page.goto(). So it sounds to me like page.gotos never work successfully (on my machine). My theory is that something in the story must be holding open too many connections. There should be one for hot module reloading, but networkidle2 means it should be able to have 2 open and still navigate. When I view a story in isolation in my normal Chrome, __webpack_hmr is the only open connection I see, but the dev tools aren't super clear.

I've had to put this project on hold for our app for now, but if I pick it up again, I'll try turning off hot module reloading and see if that makes it work.

Peeja avatar Nov 26 '19 15:11 Peeja

Having the same issue with version 5.2.8

OnrCanJotform avatar Dec 20 '19 14:12 OnrCanJotform