baerrach / gatsby-remark-plantuml

Gatsby Remark parser for PlantUML code blocks
Other
3 stars 4 forks source link

Fix build when image generation finishes early #3

Closed radnotiz closed 4 years ago

radnotiz commented 4 years ago

Closes #2

The root cause seems to be that onExit may miss the event when the subprocess is already closed.

baerrach commented 4 years ago

Thank you for a beautiful issue and pull request.

I know I pulled out the onExit to be after the Promise.all for some reason, and I should know better when dealing with race conditions and thread/process handling.

baerrach commented 4 years ago

I think I may have stuffed up the pull request history by doing a force push.

The master branch looks fine though.

radnotiz commented 4 years ago

Thank you for a beautiful issue and pull request.

I know I pulled out the onExit to be after the Promise.all for some reason, and I should know better when dealing with race conditions and thread/process handling.

Thanks for the lightning fast release! I will keep an eye on this just in case it turns out to be problematic. Cheers

baerrach commented 4 years ago

Now that I think about it, it was probably because I was still getting heisenbug behaviour and I thought doing it after would fix it.

Apply my usual non-JavaScript thinking to the problem I see I should have setup all my listener/event handling prior to doing anything that would progress the process forward so there is no possibility of dropping an event.

Which is why I moved the onExit to where it is. It really should have been in the 3rd item in the array and not the 1st so I didn't have to add that junk destructuring field. I'll fix that up later.