Skip to content

engine: make otel proxy shutdown error non-fatal - #8936

Merged
sipsma merged 2 commits into
dagger:mainfrom
sipsma:deadline-exceeded
Nov 13, 2024
Merged

sipsma merged 2 commits into
dagger:mainfrom
sipsma:deadline-exceeded

Conversation

@sipsma

@sipsma sipsma commented Nov 12, 2024 •

Copy link
Copy Markdown
Contributor

Fixes #8934

I haven't tracked down why, but it appears that sometimes in our test
workflows the "shutdown otel proxy" cleanup step takes over 10s, hits
its timeout and then causes the exec to fail.

It shouldn't take that long, but in the meantime there's no reason for
this to be fatal to the exec. The error is now just logged.


@vito let me know what you think of this workaround. I'm a bit mystified and concerned why shutting down the otel proxy server is taking >10s sometimes. The only recent change I can think of that's plausibly related is getting rid of the transactions, which I suppose could somehow be causing the http handlers take longer? Maybe? Pretty shot in the dark guess.

But for now it at least stops this from breaking user execs.

@sipsma
sipsma force-pushed the deadline-exceeded branch 2 times, most recently from 88bb11f to 0a49ba5 Compare November 12, 2024 22:21
@sipsma

sipsma commented Nov 13, 2024

Copy link
Copy Markdown
Contributor Author

Caught it after a few re-runs: https://dagger.cloud/dagger/traces/6d46046448a86fe4dcc83f4e0f9761b6?span=f64e19849bc74e52&logs

Was indeed a cleanup func, specifically shutdown otel proxy.

Need to look into why this started happening recently. Not sure if something is just taking longer than it used to (maybe related to more otel data flowing due to metrics?) or if something is actually going wrong.

Either way, that doesn't seem like something that should be fatal to an exec at least at face value.

While trying to debug a flake I was suspecting a cleanup step might be
failing. Problem is all I'm getting is "context deadline exceeded", so
if it is a cleanup step, I can't tell which one.

This updates any cleanup errors to be wrapped with the context on what
specifically failed.

Signed-off-by: Erik Sipsma <[email protected]>
I haven't tracked down why, but it appears that sometimes in our test
workflows the "shutdown otel proxy" cleanup step takes over 10s, hits
its timeout and then causes the exec to fail.

It shouldn't take that long, but in the meantime there's no reason for
this to be fatal to the exec. The error is now just logged.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma marked this pull request as ready for review November 13, 2024 18:28
@sipsma sipsma changed the title engine: wrap executor cleanup errors engine: make otel proxy shutdown error non-fatal Nov 13, 2024
@sipsma
sipsma requested a review from vito November 13, 2024 18:32

@vito vito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vito let me know what you think of this workaround. I'm a bit mystified and concerned why shutting down the otel proxy server is taking >10s sometimes. The only recent change I can think of that's plausibly related is getting rid of the transactions, which I suppose could somehow be causing the http handlers take longer? Maybe? Pretty shot in the dark guess.

...Huh, yeah that's concerning. Looking into it now. Do you happen to have a repro, or is it more possibly load-induced, so just "run the whole suite and keep an eye on the logs"?

That thread about begin tx: database is locked is also ongoing and possibly demonstrates the same issue after removing the transaction.

Might be time to add some spans to our OTel data pipeline. :yodawg:

I'm good with merging this since telemetry failures shouldn't bubble up to errors in userland imo.

@sipsma

sipsma commented Nov 13, 2024

Copy link
Copy Markdown
Contributor Author

...Huh, yeah that's concerning. Looking into it now. Do you happen to have a repro, or is it more possibly load-induced, so just "run the whole suite and keep an eye on the logs"?

Sadly no, only see it CI so far and even there it's pretty ephemeral (took ~5 retries of every test suite in this PR To hit it once). So yeah, run whole suite and ctrl-F for "context deadline exceeded". Though after this change it will be ctrl-F for "timeout waiting for OTel proxy to shutdown" in engine logs

@sipsma
sipsma merged commit b7d001e into dagger:main Nov 13, 2024
@vito

vito commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

Follow-up: #8950

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.

Ephemeral context deadline exceeded errors during Go SDK codegen

2 participants