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

vut: Extract SIGHUP handling out of daemon mode #3779

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dridi
Copy link
Member

@dridi dridi commented Feb 2, 2022

This allows VUTs to either ignore SIGHUP or react to it without daemonizing. This is useful in a linux container to avoid forking a new process when the doctrine is one process per container.

As a result varnishlog and varnishncsa now rotate logs when the -H option is used. Daemonizing implies adding a SIGHUP handler.

Coverage of both varnishncsa and varnishlog was moved to a new dedicated u20 test case to slightly simplify u3 and u6.

This changes the layout of struct VUT and as a result is breaking the ABI.


I'm opening this pull request on behalf of @Creamen to solve containers issues with log rotation. I slightly tweaked the change, added test coverage and took care of soname housekeeping.

This allows VUTs to either ignore SIGHUP or react to it without
daemonizing. This is useful in a linux container to avoid forking
a new process when the doctrine is one process per container.

As a result varnishlog and varnishncsa now rotate logs when the -H
option is used. Daemonizing implies adding a SIGHUP handler.

Coverage of both varnishncsa and varnishlog was moved to a new
dedicated u20 test case to slightly simplify u3 and u6.

This changes the layout of struct VUT and as a result is breaking
the ABI.
Copy link
Member

@nigoroll nigoroll left a comment

Choose a reason for hiding this comment

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

version bump should happen with release, other than that it makes sense

@dridi
Copy link
Member Author

dridi commented Feb 7, 2022

version bump should happen with release

It could be useful for weekly users to break linking sooner, but yes, your mileage may vary.

@dridi
Copy link
Member Author

dridi commented Feb 21, 2022

Bugwash: this one can wait until after the March release.

Comment on lines 58 to +59
" unless the -a option was specified. If the application" \
" receives a SIGHUP in daemon mode the file will be " \
" reopened allowing the old one to be rotated away. The" \
" file can then be read by varnishlog and other tools with" \
" the -r option, unless the -A option was specified. This" \
" option is required when running in daemon mode. If the" \
" application runs as a daemon (-D option) or adds a" \
Copy link
Member Author

Choose a reason for hiding this comment

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

"application application" spotted.

Copy link

Choose a reason for hiding this comment

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

Oh okay it's for the merge with OSS VC.
Shall I do anything here to help you ?
( comment apply to the next remark as well ! )

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure I'm the one who borked this one.

Copy link

Choose a reason for hiding this comment

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

I'm sorry to confirm that - I compared your branch, mine and VC master just to be sure I did not do anything wrong.
Thanks for your work !

Comment on lines 63 to +64
" unless the -a option was specified. If the application" \
" receives a SIGHUP in daemon mode the file will be" \
" reopened allowing the old one to be rotated away. This" \
" option is required when running in daemon mode. If the" \
" application runs as a daemon (-D option) or adds a" \
Copy link
Member Author

Choose a reason for hiding this comment

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

"application application" spotted.

@dridi
Copy link
Member Author

dridi commented Jul 28, 2022

Note: before merging, steps should be added in the release process to deal with libvarnishapi soname bumps.

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

Successfully merging this pull request may close these issues.

3 participants