copy value of seq to the stack to avoid race condition when generating Job names#385
Merged
franku merged 1 commit intobareos:masterfrom Jan 3, 2020
Merged
Conversation
franku
suggested changes
Dec 31, 2019
Contributor
franku
left a comment
There was a problem hiding this comment.
Looks good. However, would you mind to put your name on the AUTHORS list?
https://github.com/bareos/bareos/blob/master/AUTHORS
…in job name creation
a09da8f to
272f4f0
Compare
Author
|
Sorry, I seem to have messed something up by force-pushing the amended commit with the updated AUTHORS file. I can't see the changes you requested - hopefully the amended commit is what you wanted. Have a good weekend! |
franku
approved these changes
Jan 3, 2020
franku
added a commit
that referenced
this pull request
Jan 3, 2020
copy value of seq to the stack to avoid race condition when generating Job names
franku
added a commit
that referenced
this pull request
Jan 3, 2020
(manual merge) copy value of seq to the stack to avoid race condition when generating Job names
benibr
pushed a commit
to benibr/bareos
that referenced
this pull request
Jan 9, 2020
fixes bareos#385: bareos daemon stop restart hang if bareos-tray-monitor is connected The functionality was overengineered and did not do what it probably should do. The names workq or workqueue did not explain what the code actually did and it was not reliable. Therefore refactored the complete code: - ThreadList is now a class that contains the calls to create worker-threads who will call a pre-defined handler routine - ThreadListPrivate contains the implementation and is hidden from the public interface - using ThreadList with RAII in the daemon code, accordingly - the new functionality consists mainly of a list where new threads are added to, therefore the name of all files and variables are changed into names containing "thread list" or similar - used std::thread instead of pthread - used std::set instead of a linked list - worker threads start detached and cleanup resources by themself - removed or renamed variables - removed unused code in the thread start and at the end - previous return type of int was not used as intended, therefore a simple bool is enough - upon shutdown threads are not joined but the parent thread will wait until the thread list is empty or a timeout occurs - added a user callback for each worker-thread that is called from the parent thread before it enters the waiting state - ua_server: close user_agent_socket only in FreeUaContext - synchronize shutdown of worker threads on daemon shutdown - updated code that calls the new functions accordingly - fd and dir: added a worker-thread shutdown handler to each socket server - sd: do not cleanup jcr memory of a console connection in the terminate handler - dird: StopSocketServer is now called before StopWatchdog so socket operations still can time out - set the timeout for the second call of SSL_shutdown from 120 seconds to 2 seconds as this makes director shutdown faster - added a unit test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an issue where two jobs that were created at the same time could share a unique job name, which caused various issues.