Skip to content

learn: retrospective learnings - #251

Open
oss-engineer-bot[bot] wants to merge 51 commits into
mainfrom
ai/learning-pr
Open

oss-engineer-bot[bot] wants to merge 51 commits into
mainfrom
ai/learning-pr

Conversation

@oss-engineer-bot

@oss-engineer-bot oss-engineer-bot Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Rolling retrospective learnings

This PR accumulates one dated section of learnings per day (from merged PRs and engineer-bot author runs) until it is merged; merging it starts a fresh one. The bot never writes the canonical log directly.

Latest update 2026-11-17: 3 new learning(s) since 2026-11-16T07:33:01Z.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
@oss-engineer-bot oss-engineer-bot Bot added the engineer-bot-learning Auto-generated retrospective learning PR label Aug 14, 2026

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 3 Low

Docs-only learning-log update: the two new 2026-10-30 entries are accurate and useful. Some older entries in the same file now contradict newer ones without any note saying so. Because this file is injected into every bot prompt as a convention, those stale rules should be marked as superseded.

- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.
**Rule:** Capture a `tokio::runtime::Handle` at construction (`Handle::current()`) and spawn background work via that stored handle, never bare `tokio::spawn`, in any kernel code reachable from FFI/binding threads that may not be on a runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — Line 155 (2026-08-29) gives a blanket rule: "Capture a tokio::runtime::Handle at construction (Handle::current())". The new 2026-10-30 entry (L387) says the opposite for process-shared objects: never capture Handle::current() from a per-session runtime, because under PyO3 that runtime gets shut down when its session closes. Both bots load this file as conventions, so a future run that finds L155 first could bring back the PR #413 bug. Please add a qualifier to L155, e.g. "…for objects owned by a single session; process-shared objects must use a dedicated process-lifetime runtime (see 2026-10-30)".


### 2026-09-09: learnings since 2026-09-08T07:28:35Z
- **Context:** PR #326 gave the process-wide C-ABI Tokio runtime an explicit `thread_stack_size(2 MiB)` because, without an override, Tokio's thread builder honours the embedding process's `RUST_MIN_STACK`, letting a native consumer's env var (or `ulimit -s`) shrink kernel-owned workers below Tokio's supported default and cause stack overflows in library code.
**Rule:** When a kernel/FFI library owns its own async runtime, pin worker `thread_stack_size` explicitly — never inherit the embedding process's `RUST_MIN_STACK`/ulimit, which the host controls and can set arbitrarily small.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-09-09 rule at L205 says to "pin worker thread_stack_size explicitly". That is the fixed-constant approach PR #329 (2026-09-10) found wrong, because it shrinks a larger host RUST_MIN_STACK. The new 2026-10-30 rule correctly says to use the shared runtime_thread_stack_size(ambient_rust_min_stack()) floor helper. L205 is still unqualified, so a bot could follow it and hard-code a 2 MiB value. Please add a pointer to L205 saying it was superseded by the floor semantics and the crate::util::runtime helper.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-08-18 rule at L31 says a caller-supplied can_cloud_download is "silently dropped" because it is not in SESSION_CONF_ALLOWLIST. The 2026-08-28 entry says PR #303 removed that allowlist and caller keys now go to the wire as-is. L31 therefore describes a mechanism that no longer exists and states the wrong behaviour (dropped vs. forwarded, which poisons the session). The guidance to use disposition is still right, but the claim about the allowlist and silent drop should be marked as superseded.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Medium · 2 Low

Docs-only learning-log update; the new 2026-11-04 entry looks accurate, but the accumulated log has older rules that later entries contradict or that are now out of date. Bots read this file as repo conventions, so the older rules should be updated or point to the later entries.

- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.
**Rule:** Capture a `tokio::runtime::Handle` at construction (`Handle::current()`) and spawn background work via that stored handle, never bare `tokio::spawn`, in any kernel code reachable from FFI/binding threads that may not be on a runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — This 2026-08-29 rule tells future bots to grab Handle::current() at construction and spawn on that stored handle. The 2026-10-30 entry (PR #413) says the opposite for shared objects: Handle::current() taken from a per-session PyO3 runtime goes dead once that session's runtime shuts down, and that is exactly the bug that silently stopped telemetry flushes. .claude/knowledge/** is injected into every bot prompt, so a bot that greps for "Handle" may follow the older, unqualified rule. Please narrow this rule: a stored Handle::current() is only safe when the owner can't outlive the runtime the handle came from. Otherwise (process-shared or lease-counted objects), use a dedicated process-lifetime runtime, and the rule should point to the 2026-10-30 entry.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This rule says can_cloud_download is "not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped". PR #303 (2026-08-28 entry) removed that allowlist, so caller keys now go out on the wire as-is, and a caller-set can_cloud_download poisons the session with CONFIG_NOT_AVAILABLE. The "silently dropped" claim is out of date. A bot relying on it could wrongly conclude a caller-supplied value is harmless. Please update the rule or add a pointer to the 2026-08-28 entry.


### 2026-09-09: learnings since 2026-09-08T07:28:35Z
- **Context:** PR #326 gave the process-wide C-ABI Tokio runtime an explicit `thread_stack_size(2 MiB)` because, without an override, Tokio's thread builder honours the embedding process's `RUST_MIN_STACK`, letting a native consumer's env var (or `ulimit -s`) shrink kernel-owned workers below Tokio's supported default and cause stack overflows in library code.
**Rule:** When a kernel/FFI library owns its own async runtime, pin worker `thread_stack_size` explicitly — never inherit the embedding process's `RUST_MIN_STACK`/ulimit, which the host controls and can set arbitrarily small.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — "Pin worker thread_stack_size explicitly" (from #326) is the approach #329 later found to be a bug: a fixed absolute value shrank the 3194880-byte stacks of the ODBC partner. The 2026-09-10 and 2026-10-30 entries replace it with the 2 MiB floor helper runtime_thread_stack_size(ambient_rust_min_stack()). Since this rule is still unqualified, a bot could bring back the fixed-constant pin. Please change it to say "apply a floor, never a cap", or point it at the later entries.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Low

This PR only adds learning-log entries, and the content is accurate and useful. One minor problem: a few older Rules are later replaced by newer ones but carry no "superseded" note, and since the bots read every entry as a current convention, the stale ones could mislead them. Nit: learn: is not a standard conventional-commit type, so check that the PR-title gate accepts it (docs:/chore: would be the safe choice).

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This Rule says CAN_CLOUD_DOWNLOAD is "intentionally not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped". The 2026-08-28 entry in this same PR (PR #303) records that the allowlist was removed and caller keys are now forwarded verbatim. Both are injected as standing conventions, so a future bot could reason from the stale claim. The guidance itself (pick CloudFetch via disposition, never via session conf) still holds. Consider rewording the mechanism part, or adding a "superseded by 2026-08-28 / PR #303" note.

The same thing happens with the 2026-09-09 rule ("pin worker thread_stack_size explicitly"). The 2026-09-10 and 2026-10-30 entries replace it with a 2 MiB floor via runtime_thread_stack_size(ambient_rust_min_stack()), so read on its own the earlier wording points to the absolute-override bug that #329 fixed.

- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.
**Rule:** Capture a `tokio::runtime::Handle` at construction (`Handle::current()`) and spawn background work via that stored handle, never bare `tokio::spawn`, in any kernel code reachable from FFI/binding threads that may not be on a runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This Rule says to "Capture a tokio::runtime::Handle at construction (Handle::current())" for background work reachable from FFI/binding threads. The 2026-10-30 Rule in this PR (PR #413) says the opposite for process-shared objects: capturing Handle::current() from a per-session PyO3 runtime is exactly what broke shared telemetry flushes. Both entries are fed to the bots as conventions, so an author run could apply the older rule to a shared client and bring the bug back. Suggest narrowing this rule to "objects whose lifetime is bounded by the runtime they were built on" and pointing to the 2026-10-30 entry for process-shared objects.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 3 Low

Docs-only learning-log update; the entries are well-formed, but three earlier rules contradict later ones in the same file. Since both bots read this log as repo conventions, the outdated rules should be reworded or marked as superseded so they don't steer future runs wrong.


### 2026-09-09: learnings since 2026-09-08T07:28:35Z
- **Context:** PR #326 gave the process-wide C-ABI Tokio runtime an explicit `thread_stack_size(2 MiB)` because, without an override, Tokio's thread builder honours the embedding process's `RUST_MIN_STACK`, letting a native consumer's env var (or `ulimit -s`) shrink kernel-owned workers below Tokio's supported default and cause stack overflows in library code.
**Rule:** When a kernel/FFI library owns its own async runtime, pin worker `thread_stack_size` explicitly — never inherit the embedding process's `RUST_MIN_STACK`/ulimit, which the host controls and can set arbitrarily small.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-09-09 rule says to "pin worker thread_stack_size explicitly". PR #329 (2026-09-10 entry) and PR #413 (2026-10-30 entry) later established that a fixed pin is wrong because it shrinks a larger host RUST_MIN_STACK (e.g. databricks-odbc at 3194880). Both bots read this file as repo conventions, so a future run that greps this older rule could bring back the absolute-pin bug.

Suggested fix: reword this rule to point at runtime_thread_stack_size(ambient_rust_min_stack()) (2 MiB floor, never a cap), or mark it as superseded by the 2026-09-10 entry.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This 2026-08-18 rule says can_cloud_download is "intentionally not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped". That stopped being true when PR #303 removed the allowlist (2026-08-28 entry). Caller keys now reach the wire, and this key poisons the session with CONFIG_NOT_AVAILABLE.

A bot that trusts this rule could argue that a caller-set can_cloud_download is harmless. The part about using disposition is still correct. Suggested fix: drop or annotate the allowlist claim so the two entries agree.

- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.
**Rule:** Capture a `tokio::runtime::Handle` at construction (`Handle::current()`) and spawn background work via that stored handle, never bare `tokio::spawn`, in any kernel code reachable from FFI/binding threads that may not be on a runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This 2026-08-29 rule says "Capture a tokio::runtime::Handle at construction (Handle::current())". The 2026-10-30 entry (PR #413) says not to do that for process-shared objects, because the per-session PyO3 runtime gets shut down and every other session's flushes are silently lost.

The two rules give opposite guidance for the same kind of code (telemetry clients). Suggested fix: narrow this rule to session-owned objects, or add a pointer to the 2026-10-30 entry.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 3 Low

Docs-only change, mostly fine: I found 3 low-severity cases where an older Rule in the log is contradicted by a newer entry in this same PR. Bots read this log as repo conventions, so a stale rule can lead them back into a bug the log already records, and each older rule should be marked as superseded.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This Rule says can_cloud_download "is intentionally not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped". The 2026-08-28 entry in this same PR says PR #303 removed that allowlist, so caller keys now go to the server verbatim and the server rejects can_cloud_download at the first ExecuteStatement. This log is fed to future bots as repo conventions, so the older rule now claims something false about current behaviour (that the value is dropped). Please mark it as superseded, or reword it so the part that still holds stays (choose CloudFetch via disposition) and the allowlist claim goes.


### 2026-09-09: learnings since 2026-09-08T07:28:35Z
- **Context:** PR #326 gave the process-wide C-ABI Tokio runtime an explicit `thread_stack_size(2 MiB)` because, without an override, Tokio's thread builder honours the embedding process's `RUST_MIN_STACK`, letting a native consumer's env var (or `ulimit -s`) shrink kernel-owned workers below Tokio's supported default and cause stack overflows in library code.
**Rule:** When a kernel/FFI library owns its own async runtime, pin worker `thread_stack_size` explicitly — never inherit the embedding process's `RUST_MIN_STACK`/ulimit, which the host controls and can set arbitrarily small.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-09-09 Rule says to pin thread_stack_size explicitly. PR #329 (the 2026-09-10 entry) found that following this exact advice shrank a larger host RUST_MIN_STACK, and the 2026-10-30 entry replaces it with max(ambient, 2 MiB floor) through runtime_thread_stack_size. A bot that greps and finds only this line would bring the regression back. Add a pointer such as "superseded by 2026-09-10/2026-10-30: use a floor, not an absolute value".

- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.
**Rule:** Capture a `tokio::runtime::Handle` at construction (`Handle::current()`) and spawn background work via that stored handle, never bare `tokio::spawn`, in any kernel code reachable from FFI/binding threads that may not be on a runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-08-29 Rule says to capture Handle::current() at construction and spawn work on that stored handle. The 2026-10-30 Rule (line 387) found that doing this in a process-shared telemetry client tied it to a per-session PyO3 runtime, and its flushes stopped working once that session closed. Without a qualifier, the older rule leads straight to that bug. Narrow it to per-session-owned objects, or cross-reference the 2026-10-30 entry.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good: this PR only adds entries to the learning log and has no executable code. One low concern: a few older rules contradict later entries in the same log and should be marked as superseded before merge.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-08-18 rule says CAN_CLOUD_DOWNLOAD "is intentionally not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped". The 2026-08-28 entry in this same PR says PR #303 removed the allowlist, so caller keys, including can_cloud_download, now reach the wire.

This log is injected into every bot's system prompt as repo conventions. A future author or review run that greps for can_cloud_download will get two rules that contradict each other, and the older one wrongly says the value is filtered out.

The log has other stale-vs-superseding pairs like this:

  • 2026-08-29: "Capture a tokio::runtime::Handle at construction (Handle::current())" vs. 2026-10-30: "Never let a process-shared object … capture Handle::current() from a per-session runtime".
  • 2026-09-09: "pin worker thread_stack_size explicitly" vs. 2026-09-10/10-30: treat 2 MiB as a floor, computed as max(ambient, floor).

Fix: annotate the superseded rules inline (e.g. (superseded by 2026-08-28 / PR #303)) or reword them, so the canonical log doesn't keep both versions as equally valid conventions.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Medium

Docs-only learning-log update. One medium issue: the new 2026-11-13 CloudFetch entries contradict two earlier "never use a can_cloud_download session conf" rules that are still in the log, and since bots read this file as repo conventions, they will get conflicting guidance.


### 2026-08-28: learnings since 2026-08-27T10:33:31Z
- **Context:** PR #303 removed the `session_conf` allowlist so caller keys forward verbatim; review flagged that a caller-set `can_cloud_download` now reaches the wire.
**Rule:** SEA accepts a `can_cloud_download` session conf at CreateSession but rejects it at the *first* ExecuteStatement with `CONFIG_NOT_AVAILABLE`, poisoning every subsequent statement on the session — disable CloudFetch per-statement via the SEA `disposition` field (matching JDBC/Thrift), never via a session conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — The new 2026-11-13 entries (L424–429) say PR #436 deliberately went back to sending can_cloud_download=false as a CreateSession session_conf, and the code confirms this (src/client/sea.rs:1140-1141). Two older Rules in the same file still say the opposite, written as absolute imperatives:

  • L131 (2026-08-28): "disable CloudFetch per-statement via the SEA disposition field … never via a session conf."
  • L31 (2026-08-18): "CloudFetch is selected via the SEA request disposition, NOT a session_conf key … can_cloud_download is intentionally not in SESSION_CONF_ALLOWLIST and any caller-supplied value is silently dropped." That allowlist was already removed in fix(session): remove session conf allowlist #303, and the kernel now injects the key itself.

This file is injected into every author, follow-up and review bot run as repo conventions. With both rules present, a bot can flag the current sea.rs behaviour as a violation, or "fix" it back to disposition-based disabling. That is the same flip-flopping described in the 2026-08-26 CASE_SENSITIVE entry. Edit L31 and L131 so they are marked superseded by PR #436 (for example: "Superseded 2026-11-13: see PR #436 entry"), or reword the new entry so it explicitly overrides them. Either way, a reader grepping for can_cloud_download should get one consistent current rule.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

This PR only adds learning-log entries, and the content is fine overall. One low-severity issue: a few older rules contradict later entries in the same PR (the CloudFetch session conf, Handle::current(), stack size) and aren't marked as superseded, so future bot runs could pick up the wrong guidance.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — Some older rules in the log are written as absolute rules but are contradicted by later entries in this same PR. Nothing marks them as superseded. This file is injected into every bot run as repo conventions, so a future author or review run may follow the stale rule.

  • CloudFetch toggle: the 2026-08-18 rule (here) and the 2026-08-28 rule both say CloudFetch must be disabled via the SEA disposition field, never via a can_cloud_download session conf. The 2026-11-13 entries (PR fix(results): fetch paged results with CloudFetch disabled #436) describe the current design, which is exactly a can_cloud_download=false session conf with the disposition fixed at INLINE_OR_EXTERNAL_LINKS.
  • Runtime handle: the 2026-08-29 rule says to capture Handle::current() at construction. The 2026-10-30 rule says shared objects must not capture Handle::current() from a per-session runtime.
  • Stack size: the 2026-09-09 rule ('pin thread_stack_size explicitly') is corrected by the 2026-09-10 rule (use a floor via max(ambient, floor)).

Suggestion: add a short (superseded by YYYY-MM-DD / PR #NNN) note to each older Rule, or edit it to point at the newer entry. That way a grep that hits the old rule also finds the current guidance.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Medium · 2 Low

This is a documentation-only change to the learning log, but it needs some cleanup first: some older Rules are now contradicted by later entries and should be marked superseded. The whole log is injected as repo conventions, so stale Rules about can_cloud_download, the runtime stack size and Handle::current() can send future bot runs in the wrong direction.

**Rule:** A `#[non_exhaustive]` public struct cannot be built with struct-literal syntax from another crate — including `..Default::default()` functional-update (hard E0639) — so every `#[non_exhaustive]` config needs a `new()`/builder (repo convention, e.g. `ConnectionConfig::new`) or callers must use construct-then-mutate; remember pyo3/napi/C-ABI bindings are external crates subject to this.
- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — The log now gives opposite instructions on the CloudFetch toggle. This 2026-08-18 Rule, and the 2026-08-28 Rule at line 130, say to never send can_cloud_download as a session conf and to disable CloudFetch only through the SEA disposition. The 2026-11-13 entries (PR #436) describe the kernel deliberately sending can_cloud_download=false as a session conf, with the disposition fixed at INLINE_OR_EXTERNAL_LINKS.

The whole file is injected into every author and review run as repo conventions, so a future bot could follow either rule. For example, it could "fix" the PR #436 behavior back to disposition-based disabling, or flag it as a convention violation. Please mark the older Rules as superseded (e.g. append "Superseded by PR #436 (2026-11-13)"), or rewrite them to describe the current contract.

**Rule:** A dependency/feature change in a workspace with multiple committed lockfiles (root, `napi/`, `pyo3/`) must regenerate ALL of them — CI steps that build without `--locked` silently regenerate at build time and mask the drift.

### 2026-09-09: learnings since 2026-09-08T07:28:35Z
- **Context:** PR #326 gave the process-wide C-ABI Tokio runtime an explicit `thread_stack_size(2 MiB)` because, without an override, Tokio's thread builder honours the embedding process's `RUST_MIN_STACK`, letting a native consumer's env var (or `ulimit -s`) shrink kernel-owned workers below Tokio's supported default and cause stack overflows in library code.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This 2026-09-09 Rule ("pin worker thread_stack_size explicitly — never inherit the embedding process's RUST_MIN_STACK") reads as "always set an absolute constant". That is the exact bug PR #329 fixed the next day: a fixed 2 MiB shrinks larger host values, such as databricks-odbc's 3194880. The later entries (09-10, 10-30) define the correct rule: a floor via runtime_thread_stack_size(ambient_rust_min_stack()). Please annotate this Rule as superseded, or reword it, so a grep hit on it doesn't send someone back to the absolute override.

### 2026-08-29: learnings since 2026-08-28T10:54:51Z
- **Context:** PR #299 and PR #306 added telemetry-finalizing `close(&mut self)` inherent methods on `ExecutedStatement`/`ExecutedAsyncStatement` alongside the existing `ExecutedStatementHandle::close(&self)` trait method; the reviewer showed that with the trait in scope (or via `Box<dyn ExecutedStatementHandle>`), `exec.close()` silently resolves to the non-finalizing `&self` trait method, reintroducing the telemetry gap — the napi/pyo3 sites only worked because they used UFCS (`Type::close(&mut …)`).
**Rule:** Never rely on an inherent `&mut self` method to shadow a same-named `&self` trait method — Rust method resolution tries the `&self` receiver first and trait-object callers can only reach the trait method; give the two methods distinct names or route all callers through UFCS, and doc-note the divergence.
- **Context:** PR #297 fixed telemetry batch/timer flushes that used ambient `tokio::spawn`, which panics or drops the task when `enqueue` is called from a plain (non-runtime) thread — reachable because the pyo3/napi bindings may invoke the kernel off the runtime.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — This 2026-08-29 Rule tells authors to "capture a tokio::runtime::Handle at construction (Handle::current())". The 2026-10-30 Rule (PR #413) found that this exact pattern broke the process-shared telemetry client: in PyO3 each session owns its own runtime, and that runtime is shut down when the session closes. The rule should be narrowed to say that Handle::current() is only safe when the captured runtime outlives the object. Process-shared objects need a dedicated process-lifetime runtime. Otherwise the two entries conflict.

Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Medium · 1 Low

Docs-only learning-log update: mostly fine, with 1 medium and 1 low issue. Because the log is append-only, it now holds older rules that later entries reverse (the CloudFetch session conf, the runtime handle capture). Both bots read this file as authoritative conventions, so the stale rules should be marked as superseded.

- **Context:** PR #257 replaced the single U2M `redirect_port` with an ordered `redirect_ports` candidate list for the OAuth browser flow.
**Rule:** A U2M OAuth callback port must be a static port pre-registered as the IdP's `redirect_uri`: port `0` binds an OS-ephemeral port that can never match (reject it), and `databricks-sql-python` registers a *discrete* set (`8020`/`8025`), not a contiguous range — so never auto-walk `+N`; require caller-supplied exact ports. Exception: the default in-house app normalizes loopback redirects by dropping the port (RFC 8252 §7.3), so any `http://localhost:{port}` works only for that default client.
- **Context:** PR #184 (connection-parameter reference) — a reviewer claimed `CAN_CLOUD_DOWNLOAD` was an allowlisted server-side `session_conf` key; the code deliberately excludes it (regression tripwire `session_conf_filter_drops_can_cloud_download`, issue #196).
**Rule:** CloudFetch is selected via the SEA request `disposition`, NOT a `session_conf` key — `CAN_CLOUD_DOWNLOAD`/`can_cloud_download` is intentionally not in `SESSION_CONF_ALLOWLIST` and any caller-supplied value is silently dropped; expose the toggle only through `ResultConfig::cloudfetch_enabled` (and the client-only `cloudfetch_enabled` key), never as a server conf.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — This PR adds a CloudFetch rule that a later entry in the same PR overturns. The 2026-08-18 rule says CloudFetch is chosen by the SEA disposition, "never as a server conf", and that can_cloud_download is "intentionally not in SESSION_CONF_ALLOWLIST". The 2026-08-28 rule (line 129) says the same thing. But the 2026-11-13 entries say PR #436 changed the code so the kernel itself sends can_cloud_download=false as a CreateSession session_conf, with the disposition fixed at INLINE_OR_EXTERNAL_LINKS.

Both bots load this file into the system prompt as authoritative conventions. A future review or author run could therefore cite the older rules to flag, or even revert, the current #436 behaviour. Mark the 08-18 and 08-28 rules as superseded by the 11-13 entry, or edit them, before merging.

The same problem shows up for thread stack size: the 2026-09-09 rule ("pin worker thread_stack_size explicitly") is corrected by the 2026-09-10 and 2026-10-30 rules (use a floor with max(ambient, floor)).

- **Context:** PR #274 records CloudFetch `initial_chunk_latency` from concurrently-downloaded chunks.
**Rule:** Under concurrent chunk downloads a first-to-complete gate (e.g. `compare_exchange(-1, …)`) records the fastest/smallest chunk's latency, not chunk 0 — gate `initial_chunk_latency` strictly on `chunk_index == 0` to match the JDBC/C# `initialChunkLatency` semantic. Also keep an explicit completed-download counter so a stream dropped before any download finishes reports `None`, not a misleading `Some(0)` (both `slowest`/`sum` atomics init to 0).

### 2026-08-29: learnings since 2026-08-28T10:54:51Z

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low — The 2026-08-29 rule says to "Capture a tokio::runtime::Handle at construction (Handle::current()) and spawn background work via that stored handle". The 2026-10-30 rule from PR #413 says the opposite for process-shared objects: capturing Handle::current() from a per-session (PyO3) runtime broke telemetry flushing once that session closed. Read on its own, the older rule recommends the exact pattern #413 had to remove. Add a qualifier, for example "from a runtime that outlives the object; for process-shared objects use a dedicated process-lifetime runtime (see 2026-10-30)", so the two rules don't conflict.

This branch was previously deployed

1 inactive deployment
azure-prod — 9006e324 Deployed Nov 17, 2026 by oss-reviewer-bot[bot] via followup #3459
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineer-bot-learning Auto-generated retrospective learning PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants