-
Notifications
You must be signed in to change notification settings - Fork 1.9k
libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1 #15113
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
libzfs: sendrecv: send_progress_thread: handle SIGINFO/SIGUSR1 #15113
Conversation
96813ab
to
1ca595d
Compare
POSIX timers target the process, not the thread (as does SIGINFO), so we need to block it in the main thread which will die if interrupted. Ref: https://101010.pl/@[email protected]/110731819189629373 Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Current semantics are preserved, /except/ no-flag "zfs send" can now receive SIGUSR1/SIGINFO will write the progress. Closes: https://101010.pl/@[email protected]/110731819189629373 Signed-off-by: Ahelenia Ziemiańska <[email protected]>
1ca595d
to
1258219
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, it was a shame openzfs/openzfs#638 got left behind.
@@ -57,7 +57,7 @@ libzfs_la_LIBADD = \ | |||
libzutil.la \ | |||
libuutil.la | |||
|
|||
libzfs_la_LIBADD += -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LIBFETCH_LIBS) $(LTLIBINTL) | |||
libzfs_la_LIBADD += -lrt -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LIBFETCH_LIBS) $(LTLIBINTL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will cause issues on macOS and Windows, but they aren't in upstream yet, so you can skip over it. I will add $(LIBCLOCK_GETTIME) if'en those PRs land.
POSIX timers target the process, not the thread (as does SIGINFO), so we need to block it in the main thread which will die if interrupted. Ref: https://101010.pl/@[email protected]/110731819189629373 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#15113
POSIX timers target the process, not the thread (as does SIGINFO), so we need to block it in the main thread which will die if interrupted. Ref: https://101010.pl/@[email protected]/110731819189629373 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #15113
POSIX timers target the process, not the thread (as does SIGINFO), so we need to block it in the main thread which will die if interrupted. Ref: https://101010.pl/@[email protected]/110731819189629373 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes openzfs#15113
Motivation and Context
https://101010.pl/@[email protected]/110731819189629373
Current semantics are unchanged, except no-flag "zfs send" can now receive SIGUSR1/SIGINFO to write the progress like with -v.
Description
The thread is re-driven to use timer_create() with SIGUSR1 and pause(). Then it's dead-easy to just not timer_create() if neither of -vV.
How Has This Been Tested?
Manually by
./zfs send filling/store/nabijaczleweli/store.nabijaczleweli.xyz@2023-06-11-pre-bookworm | { sleep 3; wc -c ; }
(with varying -v/-V presence) andwhile :; do pkill -USR1 zfs; done
simultaneously.Types of changes
Checklist:
Signed-off-by
.