-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix CoreServices initalisation order #4058
Conversation
with a duration 5 ms, compared to 500 ms for initalize().
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.
Only minor comments
src/coreservices.cpp
Outdated
@@ -102,7 +102,8 @@ inline QLocale inputLocale() { | |||
namespace mixxx { | |||
|
|||
CoreServices::CoreServices(const CmdlineArgs& args) | |||
: m_runtime_timer(QLatin1String("CoreServices::runtime")), | |||
: m_pLV2Backend(nullptr), |
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.
We should initialize this plain pointer in the header with LV2Backend* m_pLV2Backend{};
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.
EffectsBackends don't even belong here. This is fixed in #2618. DlgPrefLV2 has been removed.
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.
Please do not touch any effects code before merging #2618. I refuse to fix any merge conflicts from others doing so.
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.
We should initialize this plain pointer in the header with LV2Backend* m_pLV2Backend{};
In Mixxx we only header initialization with exceptions because this introduces a hidden static constructor.
https://github.com/mixxxdj/mixxx/wiki/Coding-Guidelines#non-static-data-member-initializers
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.
I strongly disagree. It doesn't make any sense to repeat all plain pointer members and initialize them explicitly with nullptr
. This introduces useless noise. It's much more safe to initialize them directly, especially if you have many of them, see WTrackMenu. By using managed pointers this issue will hopefully disappear over time.
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.
We should revise the coding guidelines. Neither do I understand the motivation nor the issue that should be solved.
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.
"...is used if the member is omitted from the member initializer list of a constructor".
What's wrong with providing a sensible default value to prevent uninitialized members???
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 whole discussion about what to do with the pointer is moot. It is removed from this code already in #2618.
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.
What's wrong with providing a sensible default value to prevent uninitialized members???
Nothing.
The question is just where it should be done.
The normal or lets say legacy place is the initialization list in the constructor.
If we keep this habit we have a single place to look at.
Here we have the case where some variables are const initialized and some from parameter values. So you need to look at two places. The header initialization causes an extra static inline constructor and forces recompile more files if we change that value.
The solution in WTrackMenu initializes many pointers twice. One time the stat inline constructor and one time in the real constructor. This is IMHO even more an issue, because the reader might think that he has to deal with a null pointer when he looks into the header which is not the case.
I am not opposing to adjust our policy if we have sensible new ideas. But for now I like to keep the current solution here.
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.
I suggest to choose the header-only modification for minimizing the amount of changes and potential merge conflicts. In the end it doesn't matter, so let's be pragmatic.
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.
merge #2618 first
We have no policy to reject a PR, because it causes conflicts in other PRs. #2618 is not yet mature, so there is anyway something to do left. I am preparing a post, but because of the giant size it will take a while. If this introduces a merge conflicts, it will be trivial to solve, so this should be not a blocking issue for this PR. @uklotzde: |
Yes, just merge #2618, then please go ahead and rebase this. |
I consider actively interfering with others' work while simultaneously being the only one demanding their work be held up to be hostile. |
@Be-ing I don't expect any major merge conflicts. Otherwise I see myself unable to continue reviewing PRs or taking part in discussions to find a solution. |
Daniel pointed out issues, but he's not "the only one demanding to your work to be held up". Don't make this personal. I doubt @daschuer is the only one that that has reservations about #2618 without resolving these issues or at least mentioning them in a TODO. Anyway, I think it is of course possible to ask people nicely if they'd be willing to postpone their work to not cause merge conflicts in other PRs. But in general, it's the responsibility of the contributor to resolve merge conflicts if they arise. Of course, huge PRs tend to stay open longer and simultaneously cause more merge conflicts. The only way to avoid this is to avoid huge PRs. I agree with @uklotzde that the changes in this PR should should only cause trivial merge conflcits (if at all). |
This is unhelpful. |
This is also unhelpful. If you have objections, say them. |
There is an elephant in the room here. I cannot help but observe that I am treated differently. My objections to PRs get ignored (and I am not just talking about this PR, here are a few examples: #1064, #3074, mixxxdj/website#217), meanwhile @daschuer is allowed to indefinitely hold up PRs (for months at a time!) without any specific objections and hold up release blocking issues for months against the unanimous consensus of everyone else (remember the cue color debacle?). You all have let @daschuer hold up my PRs for weeks for nonsense as trivial as a code comment (#2920). I wish that was an exaggeration, but it's not, that literally happened. This is not fair and I'm not going to take it any longer. I will not keep participating in Mixxx if this is allowed to continue. There must be unbiased rules to prevent this or it will not be worth my time. |
Yes, I did approve months ago. Then @daschuer spent his free time to do an in-depth review and found issues that I overlooked. While you were away, I did spent some time towards fixing them. Not because I want Daniel to shut up, but because I agreed with him. I think it's likely that not all remaining comments are merge blockers, but this should be discussed openly and then we agree what is in scope for this PR and what is not. If you believe the discussion drags on and goes in circles, it's possible to call for a vote. But unilaterally resolving review comments without pushing a fix is not how we want or should do reviews. |
Such discussions in PR comment sections, or Zulip, are neither productive nor does anybody feels good in the aftermath. I'm sure, that every single person here works hard to bring this project forward. But these discussions here result in excatly the opposite! |
Thank you. |
This was unwanted. I specifically asked @daschuer not to do this and he refused.
It has been at that point for a long time.
I have pushed over 100 commits in response to unwanted reviews. |
Unwanted reviews? If you ask that other developers take the time to review your branch and someone does, it's not appropriate to object when they make comments and ask for changes. It is also extremely inappropriate to refuse to participate on other code reviews until your demands are met. I think we'd all like to find a way forward on 2618 but that will take working together. |
Yes, demanding that everybody else wait indefinite amounts of time because you say you want to review despite 3 other reviewers already approving is not fair at all. And now I am being demanded to wait some indefinite amount of time for some unspecified objection to merging, yet @daschuer has found time to actively interfere with merging #2618 by making this PR. |
When the reviewer has a history of incredibly insensitive demands on my code, such as holding up my work for weeks for a disagreement about a code comment, yeah, I don't want the review. I've been putting up with this for years, it's not okay, and it's not okay that everyone else tolerates it. |
I have offered repeatedly to compromise by continuing to work with @daschuer on addressing remaining issues after merging #2618 to main, but he has ignored these offers and instead demanded that I continue to wait months, meanwhile merge conflicts pile up, and he does nothing to fix them, and everyone else keeps blaming me for how big the PR is while I did almost all the work for macOS (4 straight months of it!) to get 2.3 released. |
I have repeatedly put forth proposals for formal processes on Zulip and they have been largely ignored. |
This endless obstruction was not tolerated in 2014 with #180, so I do not understand why it is now. |
There are merge conflicts now. |
Oh no ... fixed |
ready |
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.
Thank you for considering our recommendations in this special case!
@daschuer pre-commit issues? |
A white space issue. Force pushed. |
@Be-ing Ping. I would like to get consent by everyone involved. |
src/coreservices.cpp
Outdated
@@ -136,6 +132,25 @@ void CoreServices::initialize(QApplication* pApp) { | |||
m_cmdlineArgs.getLogLevel(), | |||
m_cmdlineArgs.getLogFlushLevel(), | |||
logFlags); | |||
} | |||
|
|||
void CoreServices::preInitialize(QApplication* pApp) { |
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.
Is this method really necessary? Couldn't we just make it part of the CoreServices constructor?
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.
Is there any need to create the CoreServices
object before creating a QApplication
? If not, we should move this into the constructor. Less possibilities to use this class wrong or miss an initialization step.
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.
Ping
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.
Done.
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.
There does not seem to be a purpose for this method. Move the code directly into the constructor.
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.
It is just documentation support.
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.
I don't think this makes the code more readable; it makes me wonder why the function exists. I think it would be better to move the code into the constructor and add a comment: "These need to be initialized before the GUI. They are fast to initialize. Everything else is deferred to the initialize
method so the GUI can show the progress."
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.
I like the current state.
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.
I don't to bike-shed, but
- it only contains the body of the constructor, which now contains just this single invocation and
- the method is public although it doesn't need to be.
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.
The function is private.
Done! |
Pull Request Test Coverage Report for Build 1084024096
💛 - Coveralls |
FWIW in german there's a distinction between |
I have chosen the word consent deliberately. |
In English:
"Consensus" is a complex term because there are specific systems called "Consensus Process" which have lots of details about decision-making. But in a general sense, it means "most people agree even if some have reservations, but nobody is dead-set against the idea" |
Conflicts are resolved now. Ready for merge! ? |
src/coreservices.h
Outdated
LV2Backend* m_pLV2Backend; | ||
LV2Backend* m_pLV2Backend{}; |
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.
unrelated change, please remove from this PR
Done. |
OK, again done. |
This fixes the untranslated menu bar https://bugs.launchpad.net/mixxx/+bug/1934655 and is a prerequisite of the untranslated help output fix.