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

log: wrap rotation and write in lock #2807

Closed
wants to merge 1 commit into from

Conversation

jasonish
Copy link
Member

The application log is subject to rotation, so the check for
rotation, the actual rotation and write needs to be done under
lock to ensure the file pointer is in a consisten state
at the time of write().

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2155

Prscript:

The application log is subject to rotation, so the check for
rotation, the actual rotation and write needs to be done under
lock to ensure the file pointer is in a consisten state
at the time of write().

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2155
@@ -714,6 +716,7 @@ static inline SCLogOPIfaceCtx *SCLogInitFileOPIface(const char *file,
goto error;
}

SCMutexInit(&iface_ctx->fp_mutex, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

no destroy anywhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

added it myself

@inliniac inliniac mentioned this pull request Jun 28, 2017
@inliniac
Copy link
Contributor

Merged through #2814, thanks Jason! I added a destroy call as well.

@inliniac inliniac closed this Jun 28, 2017
@jasonish jasonish deleted the issue-2155-log-locking-1 branch June 28, 2017 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants