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

test: Temporary pipeline error #2241

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

jachym-tousek-keboola
Copy link
Contributor

Jira: https://keboola.atlassian.net/browse/PSGO-1004

Changes:

  • Added a pipeline test for when NetworkFile is temporarily returning an error on write.

@jachym-tousek-keboola jachym-tousek-keboola force-pushed the jt-pipeline-test branch 2 times, most recently from 36da66b to afe3f2a Compare February 11, 2025 14:27
@jachym-tousek-keboola jachym-tousek-keboola marked this pull request as ready for review February 12, 2025 08:14
Copy link
Contributor

@Matovidlo Matovidlo left a comment

Choose a reason for hiding this comment

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

I think the test misses check for complete writing by logs

{"level":"debug","message":"flushing writers"}
{"level":"debug","message":"chunk completed, aligned = true, size = \"5B\""}
{"level":"debug","message":"writers flushed"}
{"level":"warn","message":"chunks write failed: some error, waiting %s, chunks count = 1"}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see log where chunks were written after fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The chunk completed message didn't appear in the logs. I'm not quite sure why to be honest because I don't understand how chunk writer works. The message is logged in swapChunks which I'm guessing wasn't necessary to be called in this case? However the data did appear in the stream output and I do assert that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that we assert the data but it is weird, we receive chunk write failed and being in backoff and do not see it write after backoff interval is reached. See encoding/pipeline.go:493. The operation is again retried and chunks are processed

Copy link
Contributor Author

@jachym-tousek-keboola jachym-tousek-keboola Feb 12, 2025

Choose a reason for hiding this comment

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

I think you made a typo? encoding/pipeline.go only has 480 lines so I'm not sure what line you're referring to. Anyway yes chunks are processed but I'm guessing swapChunks didn't happen or didn't do anything so it didn't get logged. Should I spend more time trying to understand what's going on with the chunk writer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the log is supposed to be there so you need to spend more time on that why it is missing. E.g deadlock occured, didn't wait enough or any other issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is actually missing on the old tests from Michal as well... Apparently the chunk is still active until you send the next record so it only gets completed when you do send the next one. But I added assertions for "chunk written" which is logged immediately.

Copy link
Contributor

Choose a reason for hiding this comment

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

So if it is missing in old tests why don't we add this into them? I understand that the chunks can be processed retrospectivelly but I would expect test to cover it fully. Or add commentary somewhere, maybe into processChunks metohd

Copy link
Contributor

@hosekpeter hosekpeter left a comment

Choose a reason for hiding this comment

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

LGTM

@jachym-tousek-keboola jachym-tousek-keboola marked this pull request as draft February 12, 2025 12:35
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.

3 participants