fix(expert): check start_child return in initialized handler#371
Open
QuinnWilton wants to merge 1 commit intoelixir-lang:mainfrom
Open
fix(expert): check start_child return in initialized handler#371QuinnWilton wants to merge 1 commit intoelixir-lang:mainfrom
QuinnWilton wants to merge 1 commit intoelixir-lang:mainfrom
Conversation
This was referenced Feb 10, 2026
34f0892 to
74ca6c9
Compare
The return value of Task.Supervisor.start_child was silently discarded.
If the supervisor is at capacity or shutting down, project
initialization would fail without any indication.
Log an error on {:error, reason} so the failure is observable.
74ca6c9 to
54171af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of a set of 4 PRs that arose out of some static analysis tooling I'm working on:
That means that these aren't crashes or issues that I've observed in practice, however based on my reading of the code, they do represent issues worth addressing.
Problem:
Project initialization tasks are spawned using
Task.Supervisor.start_child/2, however the result of this call is never checked, and if the task fails to start (because the supervisor is at capacity, for example), the failure goes unnoticed, and the project remains in an uninitialized state, with no visibility into the failure.Solution
There are two possible solutions:
:ok, and crash the caller if the task fails to startNormally (1) would be a good option, however:
GenServerfor the LSP, and crashing here would impact all other projectsIn light of both of those reasons, logging the failure is the only thing that makes sense.