Thanks for using the TrueNAS Community Edition issue tracker! TrueNAS Enterprise users receive direct support for their reports from our support portal.

alert polling certificates is inefficient and CPU intensive

Description

Our alert system is wildly inefficient since it polls (by default every 60 seconds). Diagnosing an unrelated memory leak issue, I noticed that the certificate alert is returning a HUGE amount of duplicate data. (The entire contents of all the certificates) multiple times every 60 seconds.

The culprit is the certifcate.py alert source. There are 3 different "async def check" that are running every 60 seconds. That file is calling cryptokey.load_ceritifcate and cryptokey.load_private_key multiple times.

[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_private_key' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_private_key' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_private_key' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_certificate' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>
[2021/05/19 13:08:52] (DEBUG) middlewared._call():1210 - Calling 'cryptokey.load_private_key' in executor <middlewared.utils.io_thread_pool_executor.IoThreadPoolExecutor object at 0x803d0ca30>

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk May 24, 2021 at 12:22 PM

Bug Clerk May 21, 2021 at 4:53 PM

Complete

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

More fields

Katalon Platform

Created May 20, 2021 at 4:18 PM
Updated July 6, 2022 at 9:02 PM
Resolved May 25, 2021 at 7:56 PM

Flag notifications