Skip to content

tests: fix flake in test_important_plugin from sync read EBADF - #9397

Open
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:docs-test-important-plugin-flake
Open

tests: fix flake in test_important_plugin from sync read EBADF#9397
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:docs-test-important-plugin-flake

Conversation

@daywalker90

Copy link
Copy Markdown
Collaborator

When an important plugin dies, lightningd shuts down while other plugins may still be mid-sync-RPC during init. If rpc_open() fails because the RPC socket is already gone (logging "Could not connect ... Connection refused"), sync_req() proceeds with sync_fd == -1, and the subsequent read(-1) fails with EBADF, producing the BROKEN message:

Reading sync lightningd: Bad file descriptor

This is the same intentional shutdown that already produces the whitelisted "Reading sync lightningd: Connection reset by peer" (or a clean EOF exit); the errno merely differs by the connection race. Add "Bad file descriptor" to the broken_log whitelist so the test no longer fails at teardown on this race.

Fixes: #9382

When an important plugin dies, lightningd shuts down while other plugins
may still be mid-sync-RPC during init.  If rpc_open() fails because the
RPC socket is already gone (logging "Could not connect ... Connection
refused"), sync_req() proceeds with sync_fd == -1, and the subsequent
read(-1) fails with EBADF, producing the BROKEN message:

    Reading sync lightningd: Bad file descriptor

This is the same intentional shutdown that already produces the
whitelisted "Reading sync lightningd: Connection reset by peer" (or a
clean EOF exit); the errno merely differs by the connection race.  Add
"Bad file descriptor" to the broken_log whitelist so the test no longer
fails at teardown on this race.

Changelog-None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Broken lightningd during tests/test_plugin.py::test_important_plugin

1 participant