Skip to content

fix: stop the requested backend child - #3865

Draft
ruslandoga wants to merge 5 commits into
Logflare:mainfrom
ruslandoga:rd/fix-stop-requested-backend
Draft

fix: stop the requested backend child#3865
ruslandoga wants to merge 5 commits into
Logflare:mainfrom
ruslandoga:rd/fix-stop-requested-backend

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop only the backend child whose ID was requested.
  • Cover stopping a non-first backend child and handling a missing backend ID without disturbing existing children.

Why

The piped Enum.find_value/3 call passed the apparent predicate in the default-value position and &elem(&1, 0) as the mapper. The mapper returned the first supervisor child ID, which was truthy, so enumeration stopped before comparing the requested backend ID.

Test-first result

Before changing production code:

  • mix test test/logflare/backends_test.exs:827 test/logflare/backends_test.exs:887
  • Result: 2 tests, 2 failures (99 excluded). The requested non-first backend child remained alive, and the missing-ID call returned :ok.

Verification

  • mix test test/logflare/backends_test.exs:827: 1 test, 0 failures (99 excluded).
  • mix test test/logflare/backends_test.exs: 97 tests, 0 failures (3 excluded).

@ruslandoga
ruslandoga marked this pull request as ready for review August 21, 2026 13:43
@ruslandoga
ruslandoga marked this pull request as draft August 21, 2026 14:12
@ruslandoga

Copy link
Copy Markdown
Contributor Author

Converting to draft until I simplify the test...

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.

1 participant