Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Watch log hangs when we're in a terminal state #251

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

tomasmik
Copy link
Contributor

@tomasmik tomasmik commented Aug 29, 2024

If we have no more logs and we're in a terminal state, don't wait for more, just exit. This fixes the problem of local preview not exiting.

....
╷
│ Error: Unsupported block type
│
│   on main.tf line 1:
│    1: aarsource "random_string" "random" {
│
│ Blocks of type "aarsource" are not expected here.
╵

[01J6F1AVF3VFZ7NZ7K4EMEKMW6] Unexpected exit code when initializing workspace: 1

-----------------
FAILED	Thu Aug 29 15:35:31 EEST 2024
-----------------

View full logs at http://*.app.spacelift.tf/stack/doublestack/run/01J6F2462RPSAPFCRY6GMP2FPT
2024/08/29 15:35:32 finished with FAILED state
➜  $

This was reported by a customer.

Closes: #250

Copy link
Contributor

@mbialon mbialon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the goal to exit when we fetch all logs for a terminal transition? Because we can't rely on the Finished flag.

internal/cmd/stack/run_logs.go Outdated Show resolved Hide resolved
@tomasmik tomasmik force-pushed the fix-logs-hanging-on-terminal-state branch from cb8c5b8 to 905ad68 Compare August 29, 2024 12:58
@tomasmik tomasmik requested a review from mbialon August 29, 2024 12:58
@tomasmik tomasmik merged commit 637a82d into main Aug 29, 2024
9 checks passed
@tomasmik tomasmik deleted the fix-logs-hanging-on-terminal-state branch August 29, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local preview does not exit on run failure
3 participants