Open LekoArts opened 1 year ago
@LekoArts Have you tried using lmdb@2.7.3? It does have one important fix for MacOS (#203, although this has been manifested in hanging for other users, so not sure).
Does gatsby use/open any of the same databases that parcel uses (wondering if it is an issue with different versions of lmdb connecting to the same database, which I have tried to maintain, but it is... challenging)?
Anyway, I will try to take a look at this repo, thank you for the detailed info.
No, haven't tried 2.7.3 yet!
Does gatsby use/open any of the same databases that parcel uses
No, I don't think so. We use Parcel's LMDBCache (https://github.com/gatsbyjs/gatsby/blob/204825250ca302a73e1ce695222ec29b96112782/packages/gatsby/src/utils/parcel/compile-gatsby-files.ts#L111-L112) but that shouldn't interfere at all with our usage. I just had difficulties with multiple versions for other projects (e.g. graphql, sharp) so it was just an assumption that maybe diff lmdb versions would cause a problem. But then again, 2.5.2 and 2.5.3 seemed to have worked fine together. So maybe that's just a red herring and actual problem is something in > 2.5.3
I've seen a segfault in https://github.com/kriszyp/lmdb-js/issues/205 maybe it's connected?
@LekoArts Did upgrading fix the issue for you?
Hi Kris!
For the Gatsby 5.3 release we bumped our usage of lmdb from 2.5.3 to 2.7.1 (https://github.com/gatsbyjs/gatsby/pull/37160). Gatsby also uses Parcel (which we bumped to 2.8.1) which itself uses 2.5.2 (via
@parcel/cache#lmdb@2.5.2
).Shortly after the release we saw users on Mac (we couldn't reproduce on WSL/Ubuntu or Windows) hit an issue with hard segfaults: https://github.com/gatsbyjs/gatsby/issues/37246
Internally we also saw this and told one of our engineers to attach the segfault-handler:
I also prepared a repository for you to reproduce it: https://github.com/LekoArts/lmdb-gatsby-5.3.0-segfault-repro I didn't test yet if this has to do with different lmdb versions (gatsby & parcel) or if this would happen if you'd force lmdb via resolutions to 2.7.x also in Parcel.
For now we're reverting the upgrade (https://github.com/gatsbyjs/gatsby/pull/37255) and it works now again.