Skip to content

Commit 9169b6e

Browse files
allanssonJosé Valim
authored and
José Valim
committed
Properly cancel timeout on compilation error in ParallelCompiler #7428 (#7429)
The :timed_out message was not cancelled properly when compilation failed in ParallelCompiler. This meant the timeout message would be delivered even after compilation completed. This could be problematic when invoking compilation programmatically via e.g. Mix.Task.run("compile", ["--return-errors"]) since it means that the calling process, depending on the implemenation, might crash unexpectedly or get its inbox filled with messages. The fix simply calls the cancel_waiting_timer when a compilation error has ocurred in the same way it is called in other similar cases. Signed-off-by: José Valim <[email protected]>
1 parent c2bdc66 commit 9169b6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/elixir/lib/kernel/parallel_compiler.ex

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ defmodule Kernel.ParallelCompiler do
356356
{:file_done, child_pid, file, {kind, reason, stack}} ->
357357
discard_down(child_pid)
358358
print_error(file, kind, reason, stack)
359+
cancel_waiting_timer(queued, child_pid)
359360
terminate(queued)
360361
{:error, [to_error(file, kind, reason, stack)], warnings}
361362

0 commit comments

Comments
 (0)