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 context bug which could hang forever #960

Merged
merged 4 commits into from
Jan 26, 2024
Merged

Fix context bug which could hang forever #960

merged 4 commits into from
Jan 26, 2024

Conversation

blampe
Copy link
Contributor

@blampe blampe commented Jan 26, 2024

We could hang forever if we have irregular file types present, like pipes which never close.

Here we fix the issue by only hashing regular files.

Fixes #614

@@ -898,7 +898,7 @@ func processLogLine(jm jsonmessage.JSONMessage,
info += "failed to parse aux message: " + err.Error()
}
if err := (&resp).Unmarshal(infoBytes); err != nil {
info += "failed to parse aux message: " + err.Error()
info += "failed to parse info bytes: " + err.Error()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lint fix.

Copy link

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

// it if it's not.)
err = syscall.Mkfifo(filepath.Join(dir, "pipe"), 0o666)
require.NoError(t, err)

Copy link
Member

@rquitales rquitales Jan 26, 2024

Choose a reason for hiding this comment

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

nit: consider adding an assert here that the file <dir>/pipe is is not fileMode.IsRegular() to make it more obvious that we have an irregular file.

Copy link
Member

@mjeffryes mjeffryes left a comment

Choose a reason for hiding this comment

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

Tricky!

@blampe blampe merged commit ea3bb3e into master Jan 26, 2024
17 checks passed
@blampe blampe deleted the fix-hang branch January 26, 2024 20:24
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.

Provider hangs, errors with "use of closed network connection"
3 participants