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

Add parameter to skip ignoring files #4361

Closed
wants to merge 2 commits into from

Conversation

apilaskowski
Copy link

In our use-case we have a race condition.

We are creating files, then we are setting up privileges. In function 'extend_paths' we can see that if file is not readable once it is ignored, so it happened to us, that some logs were ignored forever.

I think that introducing such parameter should be the easiest way to avoid similar problems in the future.

Which issue(s) this PR fixes:
Fixes #
Rare race condition with updating privileges to files after executing 'in_tail.rb'

What this PR does / why we need it:

Docs Changes:
New parameter in 'in_tail'

Release Note:

@apilaskowski
Copy link
Author

Why is this DCO failing? I added message required by it at the end of the commit. Can someone help?
Also, should I prepare documentation changes in this PR also, or should it be done separately?

@ashie
Copy link
Member

ashie commented Dec 12, 2023

Thanks for your contribution!

Why is this DCO failing?

The answer is described in the link:

Expected "Artur Piotr Izaak Laskowski [email protected]", but got "Artur Laskowski [email protected]".

In our use-case we have a race condition.

We are creating files, then we are setting up privileges.
In function 'extend_paths' we can see that if file is not readable once it is ignored, so it happened to us, that some logs were ignored forever.

I think that introducing such parameter should be the easiest way to avoid similar problems in the future.

Signed-off-by: Artur Laskowski <[email protected]>
@apilaskowski
Copy link
Author

DCO is now passing

@apilaskowski
Copy link
Author

I will try to fix it later today, I assume this is some problem with new parameter not being properly created. I will take a look

Signed-off-by: Artur Laskowski <[email protected]>
@apilaskowski
Copy link
Author

@ashie PTAL, i made a misspelling before

@daipom daipom added the enhancement Feature request or improve operations label Dec 14, 2023
@daipom
Copy link
Contributor

daipom commented Dec 14, 2023

Thanks for requesting the new feature!

that some logs were ignored forever.

Does this mean that the following warning log will be no longer shown?

if is_file
unless @ignore_list.include?(p)
log.warn "#{p} unreadable. It is excluded and would be examined next time."
@ignore_list << p if @ignore_repeated_permission_error
end
end
false

Or mean that the collection of the file will stop forever?

@apilaskowski
Copy link
Author

What I want to achieve is not ignoring any files, it happens that they are unreadable at the beginning, but then gets readable after some time.

I am wondering and probably missed that at the beginning, is ignore_repeated_permission_error doing just that?
I will investigate and get back to you.

@apilaskowski
Copy link
Author

I think that ignore_repeated_permission_error is working for me, thank you for your cooperation.
If I will need more I will return to this, however, for now it is working for us.

@daipom
Copy link
Contributor

daipom commented Dec 18, 2023

@apilaskowski
Thanks for your feedback!

What I want to achieve is not ignoring any files, it happens that they are unreadable at the beginning, but then gets readable after some time.

@ignore_list is just a list to control the warning message.
The list has nothing to do with whether the file is collected or not.
If a file is added to the list, the file should be collected after it gets readable.

If the file is not collected after it gets readable, there may be some other issues.
If you have any problems collecting files, please tell us again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants