Skip to content

Compare an opened core by the key it was opened with - #124

Closed
Drache93 wants to merge 1 commit into
mainfrom
fix/get-core-before-open
Closed

Drache93 wants to merge 1 commit into
mainfrom
fix/get-core-before-open

Conversation

@Drache93

Copy link
Copy Markdown
Contributor

getCore decided whether to reuse an opened core by comparing opened.key with the key it wants. A session the store hands back may not know its key until it has opened (one with a preload, for example), so a second read of the same core in the same tick compared against null and threw TypeError: Cannot read properties of null (reading 'buffer').

Two reads of a cold core in one tick are routine, since the inflate walk fills every slot of a node at once. A restarted autobee hit this booting its system bee, and because it is a TypeError, safety-catch rethrows it and the process exits.

The context now remembers the key each core was opened with and compares against that. The test in test/map-core.js opens a bee through a store whose sessions learn their key late; it throws the TypeError before this change and passes after.

… key

A session the store hands back may not know its key until it has opened,
as one with a preload does. getCore read opened.key to decide whether to
reuse it, so a second read of the same core in the same tick compared
against null and threw a TypeError. Two reads of a cold core in one tick
are routine: the parallel walk fills every slot of a node at once. A
restarted autobee hit it booting its system bee.
@Drache93
Drache93 requested a review from a team October 30, 2026 14:06
@mafintosh

Copy link
Copy Markdown
Contributor

(update corestore, you are out of date)

@mafintosh mafintosh closed this Nov 3, 2026
@mafintosh
mafintosh deleted the fix/get-core-before-open branch November 3, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants