Improve AIR run log guidance - #6417
Merged
Merged
Conversation
ben-hansen-db
commented
Aug 28, 2026
Collaborator
Integration test reportCommit: b73708f
Top 3 slowest tests (at least 2 minutes):
|
ben-hansen-db
force-pushed
the
ben-hansen/air-run-log-guidance
branch
from
August 28, 2026 23:36
d70816d to
0219af1
Compare
ben-hansen-db
marked this pull request as ready for review
August 31, 2026 02:47
vinchenzo-db
approved these changes
Aug 31, 2026
Comment on lines
+118
to
+121
| if downloadTo != "" || root.OutputType(cmd) == flags.OutputJSON { | ||
| return err | ||
| } | ||
| return handleWatchResult(cmd.OutOrStdout(), cmdctx.WorkspaceClient(ctx).Config.Profile, args[0], err) |
Contributor
There was a problem hiding this comment.
You need to catch ctrl c before this code block or else you dont actually hit handleWatchResult, something like:
streamCtx := ctx
if downloadTo == "" && root.OutputType(cmd) != flags.OutputJSON {
var stop context.CancelFunc
streamCtx, stop = signal.NotifyContext(ctx, os.Interrupt)
defer stop()
}
err = <something>
| Tip: use --watch to stream logs until the run completes. | ||
| Tip: use --watch when submitting a run to stream logs to your terminal. | ||
| Stream logs after submission using: | ||
| databricks experimental air logs 555 |
Contributor
There was a problem hiding this comment.
dumb question. Let's say a user ctrl c, we catch it but hang, will the user be able to do a second ctrl c to force exit out? If not worth seeing if we can do that.
Contributor
Author
There was a problem hiding this comment.
yeah that should be doable
`air logs` called runLogs with the plain context, so Ctrl-C killed the process before handleWatchResult could print resume guidance — only `air run --watch` installed a signal handler. Extract that handling into a shared notifyInterrupt helper and use it on the logs streaming path (not download/JSON, which keep default handling). notifyInterrupt calls signal.Stop before cancel so the cancellation is only observable once SIG_DFL is restored, letting a second Ctrl-C terminate a hung teardown instead of being buffered and dropped. Co-authored-by: Isaac <no-reply@databricks.com>
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.
Changes
air logscommand after submission.air run --watchis interrupted.Why
Make it obvious how to start or resume log streaming without making
--watchthe default.Tests
go test ./experimental/air/cmd -run 'Test(RunSubmit|AirLogsCommand|HandleWatchResult|RunWatch)'go test ./acceptance -run 'TestAccept/experimental/air/(run-submit|run-submit-deps)$' -timeout=10mgolangci-lintfor./experimental/air/cmdThis PR was written with Codex.