Conversation
8efafcb to
9c22b8d
Compare
9c22b8d to
e8c375f
Compare
e8c375f to
d127493
Compare
arogge
left a comment
There was a problem hiding this comment.
Looks pretty solid. Nevertheless, I have a few remarks.
core/src/dird/dird_conf.h
Outdated
| // base is filled with a list of "base job expressions", | ||
| // which are just normal strings, with | ||
| // Base = <text> | ||
| // inside the option block. While they are parsed | ||
| // both by the director and the file daemon, they are | ||
| // as far as I can see not used at all. | ||
| // We should think about removing all references to them. | ||
| // Maybe this was a predecessor of JobResource->base ? | ||
| // - Sebastian Sura, 12.05.2023 | ||
| alist<const char*> base; /**< List of base names (unused) */ |
There was a problem hiding this comment.
if it compiles without this, feel free to remove it.
core/src/filed/dir_cmd.cc
Outdated
| fo->base.destroy(); | ||
| fo->fstype.destroy(); | ||
| fo->Drivetype.destroy(); | ||
| fo->~findFOPTS(); |
There was a problem hiding this comment.
I would strongly favour std::destroy_at() here.
core/src/filed/dir_cmd.cc
Outdated
| for (auto& regex : fo->regex) { regfree(®ex); } | ||
| for (auto& regex : fo->regexdir) { regfree(®ex); } | ||
| for (auto& regex : fo->regexfile) { regfree(®ex); } |
There was a problem hiding this comment.
what exactly stops us from moving this (and the following free(fo->size_match);) into the dtor?
core/src/filed/fileset.cc
Outdated
| if (type == ' ') { | ||
| vec = ¤t_opts->regex; | ||
| } else if (type == 'D') { | ||
| vec = ¤t_opts->regexdir; | ||
| } else if (type == 'F') { | ||
| vec = ¤t_opts->regexfile; | ||
| } else { | ||
| return state_error; | ||
| } |
There was a problem hiding this comment.
that looke like it should have been a switch().
core/src/findlib/find.cc
Outdated
|
|
||
| fnm_flags = BitIsSet(FO_IGNORECASE, ff->flags) ? FNM_CASEFOLD : 0; | ||
| fnm_flags |= BitIsSet(FO_ENHANCEDWILD, ff->flags) ? FNM_PATHNAME : 0; | ||
| bool do_exclude = BitIsSet(FO_EXCLUDE, ff->flags); |
There was a problem hiding this comment.
| bool do_exclude = BitIsSet(FO_EXCLUDE, ff->flags); | |
| const bool do_exclude = BitIsSet(FO_EXCLUDE, ff->flags); |
core/src/win32/findlib/win32.cc
Outdated
| /* If there is any Drivetype selection set the default | ||
| * selection to false. */ | ||
| if (fo->Drivetype.size()) { wanted = false; } | ||
| if (fo->Drivetype.size() > 0) { wanted = false; } |
There was a problem hiding this comment.
| if (fo->Drivetype.size() > 0) { wanted = false; } | |
| if (!fo->Drivetype.empty()) { wanted = false; } |
d127493 to
402bfac
Compare
fd0ab2c to
07b7de2
Compare
arogge
left a comment
There was a problem hiding this comment.
Looks good. I have two minor remarks that you can address if (and only if) you need to touch the commits again for some reason.
| static inline constexpr int DataAvailable = 1; | ||
| static inline constexpr int Timeout = 0; | ||
| static inline constexpr int Error = -1; |
There was a problem hiding this comment.
if I'm not mistaken that inline is redundant, but of course not wrong.
There was a problem hiding this comment.
Ill have to check again, but at least there is a difference between static and static inline. Not sure if constexpr makes those the same again.
There was a problem hiding this comment.
https://stackoverflow.com/a/54467409 global variables should be inline constexpr to fix odr related issues that might arise. static here is just because they are defined inside the class scope.
There was a problem hiding this comment.
Seems like constexpr member variables are always inline. Thanks for the hint!
| jcr->sd_impl->dcr->rec->data = rec_data; | ||
|
|
||
| if (bs->IsError()) { | ||
| if (auto* error = handler.error()) { |
There was a problem hiding this comment.
as error is passed to Jmsg2() which isn't type-checked at all, I would feel safer with a const char* instead of an auto*
07b7de2 to
05d7580
Compare
This class reads data from the given socket asynchroniously and makes them available in a preparsed manner on the main thread. It is important that the given socket is only used by one thread at a time, as such, if you create a MessageHandler for a certain socket, you need to take care to not use that socket at all while the message handler is alive.
05d7580 to
ad4fc2b
Compare
Thank you for contributing to the Bareos Project!
This pr adds an asynchronous message buffer to the sd. This should reduce the time the file daemon has to wait when sending data to the storage daemon.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality
Tests