-
Notifications
You must be signed in to change notification settings - Fork 577
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
icinga2 daemon: write icinga2.debug only if --dump-objects given #9586
Conversation
|
|
I doubt that there's really no other place in the documentation that would benefit from mentioning the new command explicitly. So if the documentation suggests to use Additionally, it would be great if |
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.
Now the following data structure is generated for nothing unless started with --dump-objects
, you might want to optimize this:
icinga2/lib/config/configitem.cpp
Lines 288 to 300 in 0c67abe
Dictionary::Ptr persistentItem = new Dictionary({ | |
{ "type", type->GetName() }, | |
{ "name", GetName() }, | |
{ "properties", serializedObject }, | |
{ "debug_hints", dhint }, | |
{ "debug_info", new Array({ | |
m_DebugInfo.Path, | |
m_DebugInfo.FirstLine, | |
m_DebugInfo.FirstColumn, | |
m_DebugInfo.LastLine, | |
m_DebugInfo.LastColumn, | |
}) } | |
}); |
Shall I also optimise Serialize()? |
That will be the next step in this area, so ahead, will just be fun keeping the side effect of checking for circular references without making the code messy. |
So we shall (at least try to) preserve circular ref checks? IMAO useless as you can make ones at runtime. |
You have to do something about it so that it behaves consistently. Having configs that are valid if and only if you don't specify But I would be open to gracefully handling cyclic references in the debug file. Python for example does this:
|
Weeeell... you'd "just" have to remove the circular refs to start with debugging. You probably won't even need an actual Icinga 2 reload. |
Well, you already put "just" into quotation marks yourself. This means that it could happen that for a support ticket where you ask for the output of |
OK. Shall I allow Serialize() to optionally handle circular refs like this?
|
Please first share how you want to do this. Also, I feel like this might be a good cutoff point for this PR: put the initialization of
Do you have an example for creating a circular reference in a place where it would be rejected if you write it into the config? On second thought, allowing this (circular references inside of attributes of an object) might be problematic: API responses also use On third thought: At the moment, So after thinking about this in more detail, I'm not sure about this. If we'd want to do this, there should be a good concept that takes all of this into account. |
Would you prefer a no-op flag, so that it effectively just checks circular refs on demand? |
You mean for the serialization? Do you have more alternatives in mind than rewriting a separate function? I don't think I'm perfectly happy with either, but everything else that comes to my mind feels like it would end in total over-engineering. But please only make it a flag for |
to save config (re)load 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.
Just that small grammar error left: #9586 (comment)
Apart from that, should be good to go.
to save config (re)load time.
fixes #9363