Skip to content

[agent] do not always start the Agent profile dumps when the developer_mode is enabled.#3888

Merged
remeh merged 1 commit intomasterfrom
remeh/fix-profiling-condition
Jun 22, 2020
Merged

[agent] do not always start the Agent profile dumps when the developer_mode is enabled.#3888
remeh merged 1 commit intomasterfrom
remeh/fix-profiling-condition

Conversation

@remeh
Copy link
Contributor

@remeh remeh commented Jun 18, 2020

The allow_profiling configuration field isn't properly converted to a boolean (and is then a string), + is default value is True when not set.

It means that when tested again the developer_mode boolean, only the developer_mode value matters because allow_profiling is always True either because it is a non-empty string, or because it has the default value True. The only way of setting it to false is to set it to an empty string in the configuration (allow_profiling: "").

In other words:

allow_profiling = 'false'
developer_mode = True

if allow_profiling and developer_mode
→ this returns True

allow_profiling = 'false'
developer_mode = False

if allow_profiling and developer_mode
→ this returns False

It is only an issue when the developer_mode is enabled.

As soon as the `allow_profiling` flag was set in the configuration, it was
considered `True` because a cast was missing.
@remeh remeh changed the title [agent] do not start always start the Agent profile dumps. [agent] do not always start the Agent profile dumps. Jun 18, 2020
@remeh remeh changed the title [agent] do not always start the Agent profile dumps. [agent] do not always start the Agent profile dumps when the developer_mode is enabled. Jun 18, 2020
@remeh remeh merged commit 62d3053 into master Jun 22, 2020
@olivielpeau olivielpeau deleted the remeh/fix-profiling-condition branch June 18, 2021 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants