Conversation
This was referenced Sep 25, 2026
kmcginnes
added this pull request to stack #2283
September 25, 2026 22:25
kmcginnes
added a commit
that referenced
this pull request
Sep 25, 2026
## Description - `mapWithConcurrency` rejected on the first failure, but its other lanes kept looping and sending requests nobody was waiting for. The first rejection now stops the pool from starting new work. Callbacks already running aren't cancelled. - This also affects openCypher and SPARQL schema and edge connection fetches, which used to drain the whole queue after a failure. - Later in the stack, edge connection discovery relies on this, so abandoning an attempt actually stops it. ## Validation - New test: after one callback rejects, no further callbacks start. - `pnpm checks` and `pnpm test` clean on this layer. ## Related Issues - Part of #2141 (split out of #2244) - Layer 1 of 6. Stack, bottom first: #2281 → #2277 → #2278 → #2279 → #2280 → #2282 ### Check List - [x] I confirm that my contribution is made under the terms of the Apache 2.0 license. - [x] I have verified `pnpm checks` passes with no errors. - [x] I have verified `pnpm test` passes with no failures. - [x] I have covered new added functionality with unit tests if necessary. - [x] I have updated documentation if necessary.
kmcginnes
added a commit
that referenced
this pull request
Sep 25, 2026
## Description - `mapWithConcurrency` rejected on the first failure, but its other lanes kept looping and sending requests nobody was waiting for. The first rejection now stops the pool from starting new work. Callbacks already running aren't cancelled. - This also affects openCypher and SPARQL schema and edge connection fetches, which used to drain the whole queue after a failure. - Later in the stack, edge connection discovery relies on this, so abandoning an attempt actually stops it. ## Validation - New test: after one callback rejects, no further callbacks start. - `pnpm checks` and `pnpm test` clean on this layer. ## Related Issues - Part of #2141 (split out of #2244) - Layer 1 of 6. Stack, bottom first: #2281 → #2277 → #2278 → #2279 → #2280 → #2282 ### Check List - [x] I confirm that my contribution is made under the terms of the Apache 2.0 license. - [x] I have verified `pnpm checks` passes with no errors. - [x] I have verified `pnpm test` passes with no failures. - [x] I have covered new added functionality with unit tests if necessary. - [x] I have updated documentation if necessary.
kmcginnes
force-pushed
the
edge-stack/5-edge-connection-discovery-strategy
branch
2 times, most recently
from
September 25, 2026 23:16
5e92375 to
e9373f6
Compare
kmcginnes
force-pushed
the
edge-stack/5-edge-connection-discovery-strategy
branch
from
September 25, 2026 23:22
e9373f6 to
265cdac
Compare
kmcginnes
force-pushed
the
edge-stack/5-edge-connection-discovery-strategy
branch
from
September 25, 2026 23:40
265cdac to
aef270b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The sampled query from the previous layer can miss a rare edge connection. This adds an exact strategy and picks between them automatically.
groupCount()keyed by a namedproject()over every edge, which returns one entry per distinct combination rather than one per edge. Sampled is the per-type branching from the previous layer.planDiscoverypicks between them from the edge type count and the edge total. The total is now part of the query key, so an answer from a smaller graph isn't reused. Requests are bounded by edges read and by characters of query text, and sampled batches by the worst case of every branch reaching its limit.EdgeConnectionDiscoveryError, which keeps the original error as the cause and says what to change:MemoryLimitExceededExceptiongets its own display message. The ADR records every rejected query shape and what it actually returned.How to read
docs/adr/20260918-ask-the-database-for-distinct-edge-connections.md, including every rejected shape. Start here.edgeConnectionsTemplate.ts, the two shapes.discoveryPlan.ts, the decision, pure and testable without a database.index.ts, running the plan, degrading and cancelling.discoveryError.ts, what the user is told.Validation
pnpm checksandpnpm testclean on this layer.Related Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.