Todas as lições · Rust scripts and ckb-std · Começa aqui · Glossário
Close spawn pipe descriptors when an IPC channel is freedPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
A pipe fd created by ckb_pipe or inherited through spawn stays live until ckb_close is called on it, and the VM limits how many descriptors can be live at once. Code that creates channels repeatedly must therefore close both pipe ends when finished. In ckb-script-ipc, csi_free_channel did not close them before PR #32; it now closes the library-owned pipe fds, and the peer's ckb_read then returns CKB_OTHER_END_CLOSED.
Porque importa: Without closing, a script that repeatedly opens channels leaks pipe descriptors and hits the VM's descriptor limit (the test cycles 160 fds with only four live), so later ckb_pipe calls fail.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- XuJiandong/ckb-script-ipc:
c/tests/client.c,c/tests/regression.c,c/tests/server.c,crates/ckb-script-ipc/tests/generate.rs,tests/src/tests_c_impl.rs
- Conceitos
- Other
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-09
- Última mudança
- 2026-11-09
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-11-09 · XuJiandong/ckb-script-ipc · mais deste projeto
Mais sobre Rust scripts and ckb-std
- Enable molecule bytes_vec so ckb-std scripts contain no atomic instructions
- CKB VM2 READ and INHERITED_FDS syscalls take a length pointer and return status in a0
- Disable overflow checks for ckb-std when using its dummy-atomic polyfills
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Close spawn pipe descriptors when an IPC channel is freed", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/close-spawn-pipe-descriptors-when-an-ipc-channel-is-freed, CC BY 4.0, last changed 2026-11-09.