{{ message }}
Repository navigation
Conversation
…d bin running A superseded build that finished removed the newest build's token from buildRunCh, so the next change could not cancel that build and two builds ran at once. When both finished together, both stopped and restarted the bin, and the engine kept a handle on only one of the processes: the other kept running (holding the app's port) even after air exited. Builds now take a mutex, and start() closes the newest build's own stop channel, so a stop signal still never reaches a newer build (air-verse#784).
erinok
force-pushed
the
fix-overlapping-builds
branch
from
October 16, 2026 23:25
7464a67 to
b2682d2
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.

Fixes #947.
A superseded build that finished removed the newest build's token from
buildRunCh, so the next change could not cancel that build and two builds ran at once. When both finished together, both stopped and restarted the bin, and the engine kept a handle on only one of the processes: the other kept running (holding the app's port) even after air exited.Builds now take a mutex, and
start()closes the newest build's own stop channel, so a stop signal still never reaches a newer build (#784). This replacesbuildRunChand the two tests that exercised its internals; the new test also checks that the surviving process is the newest.TestOverlappingBuildsLeaveOneRunningBinscripts the failing interleaving with real processes: build 1 is superseded by build 2 and finishes first, then build 3 starts, and builds 2 and 3 are released together through a FIFO. It fails 10 of 10 runs on master and passes 10 of 10 with this change.Possible follow-up:
runBinregisters the new process withbinStopChfrom a goroutine, so a very fast build right after a restart could still miss it; we don't have a reliable repro, so no fix is attempted here.Validation: golangci-lint v2.6.1 reports 0 issues.
go test -race ./runnermatches master locally on macOS (TestGetLoggerFallsBackToRawLoggerandTestShouldIncludeIncludedFileWithoutIncludedExtfail on master too).Author: Claude Opus 5.5