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

[bug] freezer panics on missing folder #19

Open
simonhdickson opened this issue Jul 24, 2019 · 6 comments
Open

[bug] freezer panics on missing folder #19

simonhdickson opened this issue Jul 24, 2019 · 6 comments

Comments

@simonhdickson
Copy link
Contributor

From we can tell it looks like it's either a bug that there's a rogue folder in the data directory or there's a race condition where it's trying to read the directory before it has been fully created.

The error gets returned from here:

https://github.com/uw-labs/freezer/blob/master/dirs.go#L47

This occurs on startup so once the directory is in this state the only way to fix it is to delete the folder.

@mjgarton
Copy link
Contributor

Any idea how to reproduce this?

Or failing that, an example of the error output, which might hint why it happened.

@mjgarton
Copy link
Contributor

Erroring (but not panicing) I think is correct behaviour if some file already exists in there and it isn't a directory.

The other suggestion of a rogue folder shouldn't hit this because IsDir would return true.

Am I missing something?

@simonhdickson
Copy link
Contributor Author

simonhdickson commented Jul 24, 2019

This only occurs on startup, there is no error when the previous instance of this service exits prior to getting this error.

the error message looks like this: creating sink with URL freezer+s3://s3-bucket-name/folder?sse=aes256: '/folder' does not contain enough folders

I'm not sure how to best get replicate this, writing large numbers of events and restarting the service seems to be when we get this most.

@simonhdickson
Copy link
Contributor Author

The code is recursively checking the to the depth of 6 but if the we are say 3 folders deep and there are no more sub-folders then we will hit that condition here https://github.com/uw-labs/freezer/blob/master/dirs.go#L42

@mjgarton
Copy link
Contributor

Thanks. I was looking in the wrong place, I also now suspect it's a timing issue.

@mjgarton
Copy link
Contributor

One more question - Does this ever happen on startup after it's previously run okay? In other words, once the initial directory tree has been created okay?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants