Commit Graph
36 Commits
Author SHA1 Message Date
Jay 3d20e9c512 security: fix send-on-closed-channel panic; remove unbounded buffer.
Before, sends into the event buffer were not performed under mutex lock, meaning that the channel could be closed while a send is in progress, causing a panic. A relay flooding events while a Close was in progress could trigger a panic.
Also, a slow consumer in addition to a flooding relay would cause the buffered pipe to grow unboundedly, which could cause memory to run out.
Both of these were resolved by removing the buffered pipe altogether, sending directly into the events channel, and sending under mutex.
The tradeoff we accept is that to secure the code against remote vulnerabilities and ensure no messages are dropped, the consumer must drain the subscription channels to prevent backpressure and deadlocks.
2026-08-09 18:54:35 -04:00
Jay 83c923ab11 gate send actions based on whether the peer is connected. 2026-08-06 09:54:09 -04:00
Jay 70c47d7421 query: return 'missed eose' error explicitly. 2026-08-06 09:51:08 -04:00
Jay 42e6e2af83 align with honeybee updates. change ID to URL semantics. 2026-06-08 09:43:19 -04:00
Jay 69f9219819 surface honeybee.EventDialFailed through the prism event pipeline 2026-06-04 17:46:47 -04:00
Jay df0a968907 add logger to auth manager 2026-06-04 16:03:10 -04:00
Jay dae4c7773d test: EventPublisher publish accepted 2026-06-03 18:07:28 -04:00
Jay 5ba60e28ad add logging 2026-05-21 08:19:51 -04:00
Jay c6f2aec165 record observable events from request manager 2026-05-19 22:16:58 -04:00
Jay 30e9881dae incorporate observer interface into components 2026-05-19 21:20:00 -04:00
jay 62df05e01d allow queries to wait for peers to connect within its timeout 2026-05-18 12:28:49 -04:00
jay ef2308518f fix query race. fix stream id collision behavior 2026-05-18 10:40:35 -04:00
jay 34a487568b fix query event collection race 2026-05-18 10:14:41 -04:00
jay 3564b85785 feat: replace monotonic counter with base32 random suffix; default label REQ 2026-05-17 23:01:19 -04:00
jay 5bbfd9523b feat: add WithID/WithLabel options and monotonic counter for subscription IDs 2026-05-17 22:37:57 -04:00
jay 715dfa17b0 refactor: extract route funcs, unify newStream, fix query timeout leak 2026-05-17 21:53:37 -04:00
jay b1680519fb refactor: merge session into request; rename start/stop to onConnect/onDisconnect 2026-05-17 21:02:58 -04:00
jay d8a5a7a58c compressed session into manager 2026-05-17 19:34:41 -04:00
jay c2503922fc session: unified inbox channel with EOF sentinel; session owns event forwarding 2026-05-17 19:02:22 -04:00
jay 57e66e0281 query: test returns empty events and closed on relay closed 2026-05-17 16:41:32 -04:00
jay 96d7ab027b query: implement Query; spawnSession accepts query bool 2026-05-17 16:34:03 -04:00
jay e4c7cffb14 stream: guard closed and eose sends with Once; test duplicate closed 2026-05-17 15:58:14 -04:00
jay b4c36e40f0 avoid running session close under lock 2026-05-17 15:39:24 -04:00
jay b09281b5d4 close: terminate sessions, deregister all requests 2026-05-17 15:30:57 -04:00
jay a6ab7ada60 cancel: send close, terminate session, deregister request 2026-05-17 15:26:51 -04:00
jay de3a59d6a6 stream: route closed to session and request; closed deregisters and signals caller 2026-05-17 12:43:01 -04:00
jay f7948c08b8 stream: route eose to session, ignores eose subtest 2026-05-17 12:29:42 -04:00
jay 593c5b905b stream: route inbox events to request buffer 2026-05-17 12:24:09 -04:00
jay 1e1d197b85 stream: register request, spawn session, send REQ on connect 2026-05-17 12:13:30 -04:00
jay 9bd16922df session: terminates on closed signal; complete session unit tests 2026-05-17 11:50:36 -04:00
jay 5a797c11d7 session: sends CLOSE and terminates on EOSE if query 2026-05-17 11:45:23 -04:00
jay a6922182d6 session: ignores eose if stream; unify send and message loop into single for/select 2026-05-17 11:43:11 -04:00
jay 2050c03cbe session: sends req on start 2026-05-17 11:27:36 -04:00
jay 2a4b8ee5db Created skeleton for request manager 2026-05-17 11:18:37 -04:00
jay 8eca61f588 vibed request manager. 2026-05-15 15:30:21 -04:00
jay a096450fc7 refactor to peer-centric architecture 2026-05-13 16:51:09 -04:00