Track provider startup, teardown and search failures
Record Binance first-data and shutdown evidence, websocket recovery visibility, and the CLI registry reproduction. Preserve the IB venue cases and earlier symcache candidates for focused review. (this patch was generated in some part by `Codex` using `GPT-6` (`OpenAI`))wkt/federated_project_stores
parent
fdec59b94e
commit
ec676678c5
|
|
@ -1737,6 +1737,49 @@ persistence impact, a proposed clock policy and targeted regression
|
|||
results. Keep the independent FSP history-loss/stuck-volume concern
|
||||
open under [[id:piker-fsp-preserve-live-history-on-resync][its existing task]].
|
||||
Do not mark this or linked tasks accepted on implementation/test success.
|
||||
*** TODO Trace stalled IDEALPRO L1 updates after the initial snapshot
|
||||
:PROPERTIES:
|
||||
:ID: piker-idealpro-stalled-l1
|
||||
:CREATED: [2026-11-26]
|
||||
:CARRIED: 0
|
||||
:REPO: /home/goodboy/repos/piker
|
||||
:TAKEN_APPEND_OP: fx-l1-20261126
|
||||
:TAKEN_APPEND_REQUEST: 4375d75a45abb1948066d1e1f96e5237d85d2e555377f4e9d0a2ca2f91ca7987
|
||||
:END:
|
||||
During land_fsp_sync qualification EUR/CAD and USD/MXN appeared
|
||||
static. On USD/MXN the chart displayed L1 labels, TWS was ticking
|
||||
and the user saw no matching output from the filtered debug run.
|
||||
Reboot outcome pending. A cached first_quote can populate labels.
|
||||
At 17:50 Toronto time the daemon loaded 2000 one-second MIDPOINT
|
||||
bars ending at 22:50:05 UTC, started the writer, and showed no
|
||||
closed-venue warning. The reported price_tick remained 0.00005.
|
||||
FX volume is disabled by design. Investigate live bid/ask delivery.
|
||||
- [ ] Confirm debug output belongs to the active datad and compare
|
||||
simultaneous TWS vs API bids, asks and sizes on the same contract.
|
||||
- [ ] Compare reqMktData generic ticks 375,233,236 with an empty
|
||||
list under identical conditions. Capture callback counts, request
|
||||
errors and normalized quotes before inspecting SHM/UI delivery.
|
||||
The generic tick list is a hypothesis. Return the first stage
|
||||
that loses updates and the post-reboot result if available.
|
||||
*** TODO Select AGGTRADES for IB Paxos history requests
|
||||
:PROPERTIES:
|
||||
:ID: piker-paxos-history-aggtrades
|
||||
:CREATED: [2026-11-26]
|
||||
:CARRIED: 0
|
||||
:REPO: /home/goodboy/repos/piker
|
||||
:TAKEN_APPEND_OP: paxos-history-20261126
|
||||
:TAKEN_APPEND_REQUEST: 093fbc2da4ebc2084da5af96df95946dde6be60192532bee6773551f50715ba5
|
||||
:END:
|
||||
On land_fsp_sync, BTC/USD PAXOS conId 479624278 failed startup
|
||||
on Nov 26 at 17:40 Toronto time. IB rejected TRADES with 10299
|
||||
for head timestamp request 977 and historical bars request 979.
|
||||
The latter propagated through query_latest_frame to open_feed_bus.
|
||||
Prior work ba575d93 documented the rejection in a comment.
|
||||
- [ ] Use the contract-appropriate whatToShow for both requests.
|
||||
Preserve MIDPOINT on FX bars and TRADES on stock/futures bars.
|
||||
- [ ] Verify both outgoing requests in a regression check and
|
||||
qualify head timestamp and 60s/1s history on BTC.PAXOS. Report
|
||||
any independent API constraints and live-volume coverage.
|
||||
* TODO Diagnose Qt6 chart teardown SIGSEGV with native backtraces
|
||||
:PROPERTIES:
|
||||
:ID: piker-qt6-chart-teardown-sigsegv
|
||||
|
|
@ -2023,6 +2066,38 @@ event sequences, baseline/fixed state AND graphics results, remaining
|
|||
coverage gaps and required backend/order authorization to this task and
|
||||
[[id:piker-chart-disconnect-reattach-e2e][the parent E2E assignment]].
|
||||
Preserve all human-owned task and checkbox states.
|
||||
|
||||
** Binance shutdown and SHM evidence, 2026-11-06
|
||||
|
||||
A fresh-daemon network interruption recovered live ZEC spot quotes.
|
||||
On Ctrl-C at 19:44:13 while networking was returning, cancellation
|
||||
propagated through chart/feed, sampler, paper EMS and service contexts.
|
||||
The supplied masked-by-trio.Cancelled group contained cancellation
|
||||
branches; the human found no AssertionError or PDB-entry messages.
|
||||
This does not establish that every omitted traceback branch was clean.
|
||||
|
||||
At 19:44:14 the supervisor reported brokerd.binance and emsd peers
|
||||
had disconnected before acknowledging Actor.cancel(), then escalated
|
||||
to proc.kill() hard-reap. The root terminated and printed Aborted!.
|
||||
Classify this as bounded shutdown with escalation, not graceful exit.
|
||||
Recorded actors: pikerd PID 802942, brokerd.binance 804111,
|
||||
samplerd 805065, emsd 806888, paperboi.binance 807250; chart 815777.
|
||||
|
||||
A subsequent host /dev/shm and process-map inspection found six FSP
|
||||
objects still mapped by the live chart, UUID
|
||||
38a62620-30c6-4d09-86c8-3365d50b660d. The buffers were named
|
||||
38a62620_2148d1ba.fsp and 38a62620_c5cebb3f.fsp, each with first/last
|
||||
index objects. Broker/history buffers were already gone. After the
|
||||
human closed the chart, all six FSP objects disappeared. This run
|
||||
therefore does not establish an FSP SHM leak. The inspection inventory
|
||||
was /tmp/piker-binance-post-shutdown-shm.json; it is temporary evidence,
|
||||
not a durable prerequisite for reproducing the test.
|
||||
|
||||
Next action: add this network-recovery/SIGINT journey to the existing
|
||||
owned-process qualification. Capture cancel-ack/disconnect ordering,
|
||||
exit codes and owner-scoped SHM lifetime. Keep service continuity,
|
||||
bounded exit, graceful exit and resource cleanup as separate outcomes.
|
||||
|
||||
* TODO Qualify the Polars 2.x upgrade after PR94
|
||||
:PROPERTIES:
|
||||
:ID: piker-polars-2-upgrade
|
||||
|
|
@ -2136,6 +2211,53 @@ and fixed regression results, live recovery evidence and remaining
|
|||
limitations to this task. Live feeds, broker operations, commits and
|
||||
task acceptance need their own authorization. Preserve existing states.
|
||||
|
||||
** Manual qualification evidence, 2026-11-06
|
||||
|
||||
Today adds a valid-symbol search/reuse reproduction to the earlier
|
||||
invalid-venue case; do not assume these have the same root cause.
|
||||
With XRP spot backfilling and ZEC spot being reopened in another chart,
|
||||
search-selecting an already-loaded xrpusdt.spot or zecusdt.spot can
|
||||
attempt a second persistent allocation. The requesting chart fails at
|
||||
manage_history() with "Persistent shm for sym was already open?!".
|
||||
Existing charts and pikerd survive after continuing the debugger.
|
||||
Starting the second XRP chart from CLI succeeds; search selection
|
||||
reproduces the failure. Closing/reopening charts can restore reuse.
|
||||
|
||||
At the XRP failure in brokerd.binance PID 1622311, actor UUID
|
||||
01eff461-6069-446a-815d-ed7af234b5bd, fqme was
|
||||
xrpusdt.spot.binance and opened=False for the actor-owned hist buffer.
|
||||
Its first/last indices were 1253797/3143523. bus.feeds already contained
|
||||
xrpusdt.spot and xrpusdt.spot.binance, plus ZEC aliases including
|
||||
ZECUSDT.SPOT. task_lock was unlocked with no waiting tasks at inspection.
|
||||
The exact failing request spelling was not captured. Canonical alias
|
||||
reuse is implicated; this snapshot does not prove the lock race.
|
||||
|
||||
Later, multiple XRP/ZEC sockets repeatedly timed out on local relay
|
||||
send and reconnected. These are local downstream forwarding stalls,
|
||||
not evidence of exchange silence. Producers retained after failed
|
||||
allocations are a plausible cause, not established for every socket.
|
||||
Repeat on a fresh daemon before attributing healthy-feed regressions.
|
||||
|
||||
Reuse existing downstream work before writing another implementation:
|
||||
ff136ecb849910739e780f1414edf9dec2ce1bcd resolves/reuses canonical
|
||||
endpoints and scopes quote/history producer lifetime; companion
|
||||
regressions are e02a6431e3ff57cb6f27c82c79405c05c3243ad8. These are in
|
||||
the in-use sampler_tick_time_guard lineage, not proof they landed in
|
||||
the bounded Binance branch. The broad fix was deferred during this run.
|
||||
Coordinate with [[id:piker-feed-cache-first-resolution][Cache-first feed resolution]].
|
||||
|
||||
Separate first-boot compatibility failure: heavy quote overruns reached
|
||||
ctx._cancel_called and raised AttributeError with the qualified Tractor.
|
||||
The public-property correction is now present on the local Binance tip
|
||||
3e3e0fdd, cherry-picked from 526666a357a5abfdea1d0057bf8579492b564c01.
|
||||
The human reports force-pushing the Binance branch. Remote state was
|
||||
not independently fetched here. This records implementation evidence
|
||||
without changing any acceptance markers.
|
||||
|
||||
Next action: reproduce search versus CLI reuse with the same canonical
|
||||
market and private daemon, then exercise failed-startup producer cleanup
|
||||
and sibling progress using the existing downstream regression design.
|
||||
|
||||
* TODO Trace closed-order retention and dark-order persistence
|
||||
:PROPERTIES:
|
||||
:ID: piker-ems-closed-dialog-retention
|
||||
|
|
@ -2648,3 +2770,225 @@ cache ownership and refresh policy, startup API migration boundaries,
|
|||
and deterministic regression evidence to this task. Use disposable
|
||||
cache/storage and private actors; live broker operations require
|
||||
separate authorization. Preserve human-owned task states.
|
||||
|
||||
** Earlier symcache branch candidates, 2026-11-14
|
||||
:PROPERTIES:
|
||||
:ID: piker-symcache-branch-candidates-20261114
|
||||
:TAKEN_APPEND_OP: piker-symcache-candidates-20261114
|
||||
:TAKEN_APPEND_REQUEST: 17a6ae4e0673e77c51909a7b9e72679d593f5fc815055b9937c4467eb18df968
|
||||
:END:
|
||||
Objective: reconcile preserved small symcache branches before adding
|
||||
new cache machinery or retiring source refs. This is later work,
|
||||
separate from the DPI/UI landing slice.
|
||||
|
||||
Candidate inventory (local and cached remote refs, not a fresh fetch):
|
||||
- =gitea/symcache_null_cleaner@a3ed73a4=: recursively strip None from
|
||||
dicts/lists before TOML serialization. Standalone extraction of older
|
||||
macOS work; absent from main and committed in-use =179a8c81=.
|
||||
- =symcache_polishin= and =gitea/symcache_polishin@5f392ff0=:
|
||||
per-actor caching in open_symcache(). One commit above =1abd4760=;
|
||||
not patch-equivalent to committed in-use. Compare earlier =66476512=
|
||||
too; stash =856fab0f= based there contains dependency/lock changes,
|
||||
not another symcache implementation.
|
||||
- =wkt/fix_symcache_search@1606122b=: runtime =7b51927f= repairs
|
||||
search key matching and adds tests; the tip adds a clearing skill.
|
||||
Search fix is already in in-use lineage and queued for parity.
|
||||
Do not conflate serialization, actor cache lifetime and search.
|
||||
- =fix_symcache_search@9115d24d= is a differently positioned branch,
|
||||
not the same tip as the worktree branch; its IB parser has already
|
||||
been replayed separately. Inspect actual ancestry before reuse.
|
||||
- =no_symcache_no_problem@07fbe859= and cached remote aliases have
|
||||
no commits outside current local main. Do not replay their legacy
|
||||
accounting/Symbol-removal ancestry as new symcache work.
|
||||
|
||||
Next action: compare each distinct candidate with the current landing
|
||||
stack and provider-owned resolution contract, then propose dispositions
|
||||
and focused tests before any replay.
|
||||
|
||||
- [ ] Evaluate None filtering semantics, including list position loss,
|
||||
nested values and invalid provider metadata; qualify round-trip behavior.
|
||||
- [ ] Evaluate per-actor cache identity, concurrent opens, refresh and
|
||||
teardown against present provider/daemon ownership.
|
||||
- [ ] Preserve search regression coverage and source/provenance mapping;
|
||||
record selected, superseded and deferred hashes explicitly.
|
||||
- [ ] Return the comparison and proposed landing boundaries here; retain
|
||||
source branches until complete unique-content and main-land accounting.
|
||||
|
||||
No branch retirement, implementation acceptance or task-state changes
|
||||
are implied by this inventory.
|
||||
* TODO Preserve Binance first-data startup errors through producer teardown
|
||||
:PROPERTIES:
|
||||
:ID: piker-binance-first-data-startup-error
|
||||
:CREATED: [2026-11-06]
|
||||
:CARRIED: 0
|
||||
:REPO: /home/goodboy/repos/piker
|
||||
:CATEGORY: piker.data
|
||||
:END:
|
||||
Objective: preserve the intended DataUnavailable error when Binance
|
||||
receives no first quote, and stop startup producers without disrupting
|
||||
existing feeds. Next action: reproduce the full persistent-feed startup
|
||||
path with a deterministic silent websocket source before patching.
|
||||
|
||||
** Context and evidence
|
||||
During manual qualification on 2026-11-06, DOGEPAX.SPOT produced no
|
||||
bookTicker or aggTrade messages. wait_for_live_quotes() timed out after
|
||||
16 seconds and raised DataUnavailable with the market in its reason.
|
||||
The caller ultimately saw RuntimeError("child exited without calling
|
||||
task_status.started()") from Nursery.start(), losing that useful error.
|
||||
The supplied trace ended in brokerd's debugger; root-daemon death was
|
||||
not established by that excerpt.
|
||||
|
||||
The Trio start() frame showed a partial of stream_quotes with
|
||||
symbols=['DOGEPAX.SPOT']; its nursery cancel_called/cancelled_caught
|
||||
were both False. In allocate_persistent_feed, feed_is_live was unset.
|
||||
The quote channel had zero buffered messages, zero open senders, one
|
||||
receiver and no waiting senders/receivers. No DOGEPAX entry was published
|
||||
in bus.feeds; existing ZEC/XRP aliases remained. Nested websocket/relay
|
||||
teardown emitted cancellation groups and masking diagnostics. The
|
||||
precise error-swallowing boundary remains unresolved.
|
||||
|
||||
Source checkout: wkts/land_binance_usdm_feed. Relevant boundaries are
|
||||
brokers/binance/feed.py wait_for_live_quotes(), open_quote_stream(),
|
||||
stream_quotes(), data/_web_bs.py open_autorecon_ws(), and
|
||||
data/feed.py allocate_persistent_feed(). The helper-only timeout test
|
||||
does not establish error propagation through this production lifetime.
|
||||
|
||||
** Execution and verification
|
||||
- [ ] Add a regression through Nursery.start and persistent allocation;
|
||||
require the original DataUnavailable reason rather than a missing
|
||||
task_status.started RuntimeError or indefinite loading.
|
||||
- [ ] Inspect nested nursery/context cancellation without suppressing
|
||||
genuine errors or reporting readiness before usable first data.
|
||||
- [ ] Prove websocket/relay producers exit after failed startup, an
|
||||
existing sibling keeps consuming quotes, and a later valid request
|
||||
succeeds on the same daemon.
|
||||
- [ ] Cover bid/ask-first readiness separately from no-first-data;
|
||||
verify subsequent trades/bars without zero-price startup artifacts.
|
||||
|
||||
Coordinate cleanup with
|
||||
[[id:piker-binance-invalid-fqme-backpressure][Binance startup/backpressure]].
|
||||
Return cause, focused patch boundaries, regression results and remaining
|
||||
manual qualification to this task. Preserve human acceptance states.
|
||||
|
||||
* TODO Log websocket reception resuming after receive timeouts
|
||||
:PROPERTIES:
|
||||
:ID: piker-websocket-receive-resumption-logging
|
||||
:CREATED: [2026-11-06]
|
||||
:CARRIED: 0
|
||||
:REPO: /home/goodboy/repos/piker
|
||||
:CATEGORY: piker.data
|
||||
:END:
|
||||
Objective: make recovery visible when an existing socket resumes data
|
||||
without reconnecting. Next action: add a focused shared-wrapper test
|
||||
for receive timeouts followed by successful delivery on the same socket.
|
||||
|
||||
** Context and evidence
|
||||
In a fresh-daemon ZEC spot network-interruption test on 2026-11-06,
|
||||
bookTicker and aggTrade logged websocket-receive timeout counts 1, 2
|
||||
and 3 at 16-second intervals. The human confirmed live quotes returned.
|
||||
The excerpt had no reconnect or receive-resumed message. Existing INFO
|
||||
messages report ready and first relay once per connection, so same-
|
||||
socket resumption can remain silent. Actual reconnection was not proven.
|
||||
|
||||
Inspection found phase-specific timeout and per-connection first-message
|
||||
logging, but no receive-resumed log in the qualified Binance wrapper or
|
||||
the inspected sampler_tick_time_guard version. This is an observability
|
||||
follow-up, not evidence that live recovery failed. Current timeout counts
|
||||
accumulate per connection; changing retry-counter policy is a separate
|
||||
behavior decision and is not implicitly part of this logging change.
|
||||
|
||||
** Execution and verification
|
||||
- [ ] Log one clear INFO recovery transition after receive starvation,
|
||||
including route and elapsed/timeout context without per-tick noise.
|
||||
- [ ] Preserve the distinction between successful socket reception and
|
||||
successful local relay delivery; do not announce downstream recovery
|
||||
while forwarding is still blocked.
|
||||
- [ ] Cover same-socket resumption, actual reconnect and local relay
|
||||
blockage using the existing tests/test_websocket.py loopback fixtures.
|
||||
|
||||
Return logging semantics, focused regression evidence and any unresolved
|
||||
counter-policy question to this task. Shared-wrapper users include
|
||||
Binance spot/USD-M and Kraken; do not assume untested provider recovery.
|
||||
|
||||
* TODO Fix CLI search crash from uninitialized daemon registry addresses
|
||||
:PROPERTIES:
|
||||
:ID: piker-cli-search-daemon-registry-addrs
|
||||
:CREATED: [2026-11-12]
|
||||
:CARRIED: 0
|
||||
:REPO: /home/goodboy/repos/piker
|
||||
:CATEGORY: piker.service
|
||||
:END:
|
||||
Objective: let CLI symbol search discover or spawn its data services
|
||||
without crashing when daemon startup options are supplied.
|
||||
Next action: add a broker-free regression for nonempty pikerd_kwargs
|
||||
in maybe_spawn_daemon(), then resolve registry selection independently
|
||||
of unrelated startup options while preserving explicit overrides.
|
||||
|
||||
** Reproduction and observed failure
|
||||
The human ran =piker search cerebras= on their in-use branch
|
||||
=wkt/history_segment_refill= at 2026-11-12 16:07:33 America/Toronto.
|
||||
The query root =piker_query_3470364= crashed with two search-backend
|
||||
sub-exceptions. Repeated cleanup logs reported:
|
||||
|
||||
#+begin_example
|
||||
UnboundLocalError: cannot access local variable 'registry_addrs' where it is not associated with a value
|
||||
piker/service/_daemon.py:91: registry_addrs=registry_addrs
|
||||
#+end_example
|
||||
|
||||
Call path: brokers.cli.search -> brokers.core.symbol_search /
|
||||
search_backend -> data._daemon.maybe_spawn_datad ->
|
||||
service._daemon.maybe_spawn_daemon -> find_service. The error occurs
|
||||
before service lookup or spawning. The supplied run subsequently
|
||||
entered the post-mortem debugger and still failed after continuing.
|
||||
|
||||
** Inspected cause and source context
|
||||
At the inspected source, =registry_addrs= is assigned only under
|
||||
=if not pikerd_kwargs:=, then read unconditionally by =find_service()=
|
||||
and later forwarded to =maybe_open_pikerd()=. =search_backend()= passes
|
||||
=infect_asyncio=getattr(mod, '_infect_asyncio', False)=, and
|
||||
=maybe_spawn_datad()= forwards it through =**pikerd_kwargs=. That
|
||||
mapping is nonempty even when the option's value is False, so the
|
||||
registry initialization branch is skipped.
|
||||
|
||||
[[file:../../history_segment_refill/piker/service/_daemon.py::81][Conditional registry initialization and failing lookup]]
|
||||
[[file:../../history_segment_refill/piker/brokers/core.py::175][Search passes infect_asyncio to daemon startup]]
|
||||
[[file:../../history_segment_refill/piker/data/_daemon.py::301][Data-daemon wrapper forwards startup kwargs]]
|
||||
[[file:../../history_segment_refill/piker/service/_daemon.py::212][Exception cleanup logs and releases the owned lock]]
|
||||
|
||||
The checkout inspected for this report is at =179a8c81=, with staged
|
||||
history/refill/storage work and additional unstaged edits. The failing
|
||||
service module has no local diff. This observation does not establish
|
||||
that every dirty source byte matches the original crashed process.
|
||||
The supplied trace loads Tractor from
|
||||
=/home/goodboy/repos/tractor/wkts/ipc_fault_regressions= and CPython
|
||||
3.13.14; its exact Tractor revision was not established.
|
||||
|
||||
** Related diagnostics and scope
|
||||
The repeated "Releasing stale lock after crash..?" messages come from
|
||||
exception cleanup, not evidence of the original cause or proof that
|
||||
an earlier process left a stale lock. Tractor also warns "Setting final
|
||||
outcome msg AFTER ._send_chan.send_nowait()??" around Return messages.
|
||||
Preserve those as observed diagnostics; their causal relation to the
|
||||
Piker initialization error is unproven. Do not suppress them as a fix.
|
||||
This is distinct from the existing IB empty-result/search-cache task.
|
||||
|
||||
** Execution, verification and handback
|
||||
- [ ] Reproduce without brokers using nonempty startup kwargs,
|
||||
including =infect_asyncio=False= and True, and assert registry
|
||||
selection before service lookup rather than an UnboundLocalError.
|
||||
- [ ] Cover empty kwargs, explicit registry addresses and inherited
|
||||
runtime addresses; define override precedence and forward each
|
||||
keyword once while retaining unrelated startup options.
|
||||
- [ ] Qualify existing-service reuse and absent-service spawn paths;
|
||||
verify owned-lock release after failure and successful later retry.
|
||||
- [ ] Exercise multi-backend symbol search through its real wrappers;
|
||||
preserve meaningful error propagation and bounded cleanup on failure.
|
||||
- [ ] After the focused regression passes, repeat the human's command
|
||||
in the selected runtime with separately authorized live backends.
|
||||
|
||||
Return the focused fix, exact source/runtime revisions, regression
|
||||
results and CLI reproduction outcome to this task. This report records
|
||||
source inspection and the human's trace; no search, broker connection,
|
||||
application test or implementation change ran during logging. Preserve
|
||||
all existing task/checklist states and unrelated worktree edits.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue