Repository navigation
Mark modules to infer from before the parallel checker replies - #16254
Merged
josevalim merged 1 commit intoDec 1, 2026
Merged
Conversation
Module.ParallelChecker.init/1 acknowledged its start before it marked the modules of the :infer_signatures applications as :uncached in its table. A compilation that looked up a remote such as Integer.parse/1 in that window found no entry, fetch_export/5 returned :badmodule, and the inferred signature fell back to dynamic(). On BEAM, a Process.sleep(50) after the acknowledgement makes it fail every time; with this change it passes. Found with rotp's simulation mode.
josevalim
pushed a commit
that referenced
this pull request
Dec 2, 2026
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.
Module.ParallelChecker.init/1acknowledged its start (:proc_lib.init_ack/1) before it marked the modules of the:infer_signaturesapplications as:uncachedin its ETS table.start_link/1could therefore return while the table was still empty. A compilation that looked up a remote such asInteger.parse/1in that window found no entry.fetch_export/5returned:badmoduleand the inferred signature fell back todynamic().The window is short, so this rarely happens on a normal run. But it can happen whenever a checker starts: in
Kernel.ParallelCompilerand when a module is defined at runtime withCode.eval_*/Code.compile_*. When it does, the signatures inferred for that compilation are worse, and the type warnings depend on timing.This PR fills the table before acknowledging. It adds no test, because the window can't be widened from the outside without changing the code.
How it was found
Module.Types.InferTest"from Elixir built-in" failed in 1 of 40 seeds of a deterministic-simulation sweep of the stdlib suite In the failing run the test got:How it was verified
Process.sleep(50)after:proc_lib.init_ack/1onmainmakes the test fail every time. With this change and the same sleep, it passes.Assisted-by: Claude Code Opus 5.5