Commit e3dcfc0
TS: pump in-process FFI inbound frames promptly (fix macOS RPC hangs)
The in-process FFI host has no libuv handle of its own, so koffi delivers inbound
(server→client) frames only when the event loop turns. The keep-alive timer used
a 60s interval, which kept the loop from exiting but let it park between ticks.
When the SDK issues a bare request and only awaits the response — e.g. the
sequential `session.rpc.permissions.*` calls — there is no other loop activity,
so on macOS the inbound response frame sat undelivered until the next tick and
the round-trip stalled past the test timeout. Streaming turns kept the loop busy
and so were unaffected, which is why only a handful of RPC-only tests hung and
only on macOS.
Shorten the pump interval so inbound frames are serviced within a few
milliseconds. The empty callback is cheap and only runs while a connection is
open. This is the koffi analogue of the .NET host's thread-safe Channel
callback, which wakes its reader immediately regardless of loop state.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent afecf46 commit e3dcfc0
1 file changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
133 | 143 | | |
134 | 144 | | |
| 145 | + | |
| 146 | + | |
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
| |||
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
252 | | - | |
| 264 | + | |
253 | 265 | | |
254 | 266 | | |
255 | 267 | | |
| |||
0 commit comments