stats: Configure default max_obj_name_length at compile time#2768
stats: Configure default max_obj_name_length at compile time#2768rlenglet wants to merge 1 commit intoenvoyproxy:masterfrom rlenglet:fix-default-max-obj-name-len
Conversation
DEFAULT_MAX_OBJ_NAME_LENGTH was still hard-coded to 60. Set it to ENVOY_DEFAULT_MAX_OBJ_NAME_LENGTH to make it configurable at compile time. Signed-off-by: Romain Lenglet <romain@covalent.io>
|
Istio always passes |
htuch
left a comment
There was a problem hiding this comment.
Thanks. I don't think we need a test here, since it would involve a distinct build target in CI, so seems reasonable. Will leave for @ggreenway to merge in case he has any additional input.
|
I'm missing a piece of why this is needed. As I understand it, 'DEFAULT_MAX_OBJ_NAME_LENGTH' is only used by the tests. The value used by any non-test comes from the command-line options, and the default is already set at compile-time. So I don't understand what issue is being fixed here. |
|
@ggreenway
But the other bug, which is fixed in this PR, is that |
|
I think the bug is that RawStatData::maxObjNameLength() is called before it has been configured; I do not think this is the correct fix. Can you please get a backtrace from that RELEASE_ASSERT triggering? I suspect there is a startup ordering problem. |
|
I've not been able to get a backtrace yet. |
|
The problem is that the backtrace would be useless. We need to know what calls |
|
Oh right, you're correct that the backtrace is useless. Here's how I would debug: Add a static bool 'configured_' next to 'max_obj_name_length'. Set it to true in RawStatData::configure(). Then add 'RELEASE_ASSERT(configured_)' in RawStatData::maxObjNameLength(). This build will fail tests, but ignore that. Run it in your environment and get a backtrace from that, and we should get the answer of what is calling it too early. |
|
Also, regarding the change in this PR, my clarified objection: The bug is that both the compile-time and CLI option are not working for setting the max name length. The change in this PR only fixes the compile-time option; I'm pretty sure the CLI option would still not work. I'd like to fix both. |
|
I can also try doing this, temporarily: My problem is that I've not able to get backtraces with the other assert, even with a debug build. I need to look deeper into that. |
|
Another thought on this issue: Right now, only users that use a non-default value for this CLI option will hit this issue. If we changed the default value of DEFAULT_MAX_OBJ_NAME_LENGTH to be different from the CLI option, this issue would have been detected sooner, and hopefully tracked back to the commit that introduced the problem very quickly. |
|
Interesting. I can't reproduce the issue with This leaves us with the bug of configuring |
|
DEFAULT_MAX_OBJ_NAME_LENGTH should only matter for the tests, because we always configure it with the CLI value, even if the default CLI value is used (which can be set at compile time). So I don't think any change is needed, if this is now working for you against HEAD. |
|
FYI, here's the stacktrace for the call to |
|
That makes sense in the commit you referenced. The hot restarter is always created before the call to RawStatData::configure() in that commit. It was fixed later. Broken version (which you had in your fork): Fixed version: |
|
@rlenglet I think there is nothing to fix here. Are you ok with closing this PR? |
|
Sounds good. Thanks! |
envoyproxy/envoy#2768 Signed-off-by: Romain Lenglet <romain@covalent.io>
stats: Configure default max_obj_name_length at compile time
DEFAULT_MAX_OBJ_NAME_LENGTH was still hard-coded to 60.
Set it to ENVOY_DEFAULT_MAX_OBJ_NAME_LENGTH to make it configurable
at compile time.
Signed-off-by: Romain Lenglet romain@covalent.io
Risk Level: Low