Skip to content
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

Bot statistics enabled by default cause performance drop, disabling them is not possible #2103

Closed
ghost opened this issue Sep 8, 2021 · 1 comment · Fixed by #2104
Closed
Labels
bug Indicates an unexpected problem or unintended behavior component: core
Milestone

Comments

@ghost
Copy link

ghost commented Sep 8, 2021

If the value of parameter statistics_host is null, the following exception is thrown:

    self.instance = bot(bot_id, disable_multithreading=True)
  File "/usr/lib/python3/dist-packages/intelmq/lib/bot.py", line 1164, in __init__
    super().__init__(bot_id=bot_id)
  File "/usr/lib/python3/dist-packages/intelmq/lib/bot.py", line 239, in __init__
    ttl=None,
  File "/usr/lib/python3/dist-packages/intelmq/lib/cache.py", line 27, in __init__
    if host.startswith("/"):
AttributeError: 'NoneType' object has no attribute 'startswith'

null should be handled gracefully (i.e. no statistics be written)

@ghost ghost changed the title 032562 blank Sep 8, 2021
@ghost ghost changed the title blank statistics host null causes exception Sep 8, 2021
@ghost ghost added bug Indicates an unexpected problem or unintended behavior component: core labels Sep 8, 2021
@ghost ghost added this to the 3.1.0 milestone Sep 8, 2021
@ghost ghost changed the title statistics host null causes exception statistics_host null causes exception Sep 8, 2021
waldbauer-certat added a commit that referenced this issue Sep 9, 2021
Fixes #2103

Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
@ghost ghost changed the title statistics_host null causes exception Bot statistics enabled by default cause performance drop, disabling them is not possible Sep 9, 2021
@ghost
Copy link
Author

ghost commented Sep 9, 2021

With 3.0.1, the bot statistics are enabled by default and disabling them, is not possible due to this bug.

As the statistics cause a performance issue they should not be enabled by default (e.g. with host set to null) and this bug fixed all in one.

@ghost ghost modified the milestones: 3.1.0, 3.0.2 Sep 9, 2021
@ghost ghost closed this as completed in #2104 Sep 10, 2021
ghost pushed a commit that referenced this issue Sep 10, 2021
Fixes #2103

Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants