Skip to content

docs(external-datasources): a borrowed-credential connect failure recovers without a restart - #31331

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9xq009
Nov 8, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9xq009

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread

Fixes #31325

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:只改文档。external-datasources.mdx §4「借用连接器凭据」在 "Fail-closed at connect" 下面加一条 "Recovery without a restart":插件驱动的数据源开机借不到连接器实例的凭据会记为失败,实例修好后,下一个请求借用成功就自动撤销失败,不用重启。§3 的 OS_ALLOW_DRIVER_CONNECT_FAILURE 提示里补一句「这是唯一的例外」;odata-datasources.mdx 原有的指向 §4 的链接说明里加上「也讲了怎么恢复」,不重复规则。
  • 为什么改:这是 fix(service-datasource): an adopted plugin driver's failed-credentials verdict clears on the next granted borrow, and the connector path withholds the form-encoded credential spelling #27990 合入的行为(DatasourceConnectionService.retractOnLend),指南只写了连接失败,没写会自动恢复。
  • 风险与回滚:纯文档,不发布任何包,无 changeset。回滚即还原这两个文件。
  • 先看:content/docs/data-modeling/external-datasources.mdx 新加的 "Recovery without a restart" 一条。
  • 需要你做的:无,席位落地。

What changes

  • external-datasources §4, "Borrowing a connector instance's credential": a new rule, "Recovery without a restart", right after "Fail-closed at connect". Each sentence and the code it holds against, in packages/services/service-datasource/src/datasource-connection-service.ts at origin/main 604a2b3:
    • The connect judges the instance once; the plugin driver stays registered and borrows again on each request: the already-registered guard in attemptConnect records failed-credentials without evicting the driver, and driver-odata drops a refused borrow and borrows again on the next request (packages/drivers/driver-odata/src/plugin.ts).
    • It applies when the failure did not stop the boot (no gate refuses it, or OS_ALLOW_DRIVER_CONNECT_FAILURE is set): handleFailure throws in the other cases, so there is no process to recover.
    • error in Setup and 503 until the repair: failed-credentials maps to availability failed; a refused borrow on a read is answered 503 (the odata guide's fail-closed rule).
    • The first borrow granted for that instance clears it and the datasource reads ok: retractOnLend re-records already-registered (availability available), which clears the engine's unavailable mark through recordState.
    • A grant for a different instance leaves it standing: retractOnLend skips entries whose connector differs.
    • A reconnect or edit in between records its own result: attemptConnect and disconnect drop the awaitingLend entry, and retractOnLend also checks the retained state is still the recorded verdict and the driver is still registered.
    • It needs a lender that reports grants (onLent), which @objectstack/service-automation's source does (announceLent in borrow); otherwise subscribeToLends answers false and the verdict stands until a restart.
    • The DEGRADED BOOT banner says which: the recovery sentence names the instance when retractable, else the default "until it is reachable AND the server is restarted".
  • external-datasources §3, the OS_ALLOW_DRIVER_CONNECT_FAILURE callout: its "nothing re-runs the connect ... until the server is restarted" now names this case as the one exception and links to §4.
  • odata-datasources §3: the fail-closed bullet already pointed at §4 for the rules; the pointer now says §4 also covers the recovery. The rule is not restated there.

Why

#27990 made the retraction, and the guide still described a borrowed-credential connect failure as lasting for the process. A reader who repairs the connector instance had no way to know a restart is not needed, or when it still is.

Verification

  • node scripts/check-doc-authoring.mjs: exit 0.
  • node scripts/check-doc-anchors.mjs: exit 0, 945 internal fragment links resolve (the two new links included).
  • Every sentence read against the code named above at 604a2b3, and against datasource-connector-credential.test.ts (the retraction and banner cases).

Acceptance notes

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind. (no names)
  • 3. No formatter ran; pnpm lint passes. (docs only)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ihL2fHTwitn43z5tu7gTt

…thout a restart

A plugin-driver datasource whose connector instance could not lend at
connect is recorded failed, but the driver stays registered and borrows
again on each request. The first borrow the lender grants for that
instance retracts the failure (DatasourceConnectionService.retractOnLend),
so the datasource reads ok again with no restart. The guide only said the
connect fails.

- external-datasources §4: a "Recovery without a restart" rule under
  "Fail-closed at connect": when it applies, that only a grant for the
  same instance clears it, that a lender without onLent (or none) leaves
  it until a restart, and that the DEGRADED BOOT banner says which.
- external-datasources §3: the OS_ALLOW_DRIVER_CONNECT_FAILURE callout
  names this as the one exception to "until the server is restarted".
- odata-datasources: the existing pointer to §4 now says it covers the
  recovery too, instead of restating it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2fHTwitn43z5tu7gTt
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 8, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 8, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV
ACCEPT · PR #31331 @ 58f27e91 · 2026-11-08T02:33Z

维护者速读

  • 改了什么: 外部数据源指南 §4(借用连接器凭据)新增「无需重启即可恢复」一条:插件驱动的数据源(例如 OData)开机时借不到连接器实例的凭据,会被记为失败,请求返回 503;实例修好后,下一次请求让借出方成功借出该实例,失败判定就自动撤销,不用重启。借出方不报告借出(或没有借出方)时,仍需重启;开机降级横幅会说明属于哪种。§3 的 OS_ALLOW_DRIVER_CONNECT_FAILURE 提示里补一句「唯一例外」并链到 §4;OData 指南只加指向,不重复规则。
  • 为什么改: 这是 fix(service-datasource): an adopted plugin driver's failed-credentials verdict clears on the next granted borrow, and the connector path withholds the form-encoded credential spelling #27990 已上线的行为,但指南只写了开机失败、没写会自动恢复。
  • 风险与回滚: 只改文档,不改 spec、不改代码(Clause-②: no)。还原即可回滚。
  • 需要你做的: 无,席位落地。

席位意见:ACCEPT。无契约面:Clause-②: no,不碰 packages/spec/src/**,也不是 governed 路径。按 contract-review.md,这种情况的复核记录是 CI 加席位自读,本条即席位自读。无 must-fix。

席位核对

  1. Shape: +19/−2 across 2 files. In external-datasources.mdx, a new "Recovery without a restart" bullet in §4 and one sentence in the §3 OS_ALLOW_DRIVER_CONNECT_FAILURE callout naming the exception. In odata-datasources.mdx, the existing pointer to §4 is extended; the rule is not restated. That matches the card's "say it once".
  2. Read against the code at origin/main: each sentence holds against datasource-connection-service.ts.
    • The failed-credentials verdict is recorded with awaitingLend only when the lender offers onLent.
    • retractOnLend re-records already-registered only for the same instance, only while the verdict is unchanged, and only while the plugin driver is still registered.
    • attemptConnect drops the entry on reconnect or edit, which is "records a result of its own".
    • The banner's recovery text names the instance, or falls back to "until it is reachable AND the server is restarted".
  3. Gate check-runs on 58f27e91: 48 runs: 28 success, 19 skipped, and Test Core (1/8) still running; none failed. Docs-only, so that shard does not read these files, and automerge waits for it anyway. Local: 43 derived gates, all exit 0 (os-dev-report 6716209176).
  4. Seat read: the §3 sentence is outside §4 but inside the claimed file. It removes a contradiction, because "until restarted" would otherwise be false for this case.
  5. Out of scope: none.
  6. Landing: not governed (check-governed-merges --pr 31331; 21 lines ≤ 3000). skip-changeset is correct for docs. The seat lands it through the relay.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 02:33
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 02:33
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 30e0bd1 Nov 8, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-9xq009 branch November 8, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants