searxng/searx
Markus Heiser a954b6fce1 [fix] calculator plugin: subrocess is not closed on timeout
The issue was introduced in commit: edfbf1e

Problematic code::

    def timeout_func(timeout, func, *args, **kwargs):
        ...
        if not p.is_alive():
            ret_val = que.get()
        else:
            logger.debug("terminate function after timeout is exceeded")  # type: ignore
            p.terminate()
        p.join()
        p.close()

The `logger` function in the `else` path is not defined.  Was accidentally
removed in commit edfbf1e without providing an appropriate replacement.::

    File "/usr/local/searxng/searx/plugins/calculator.py", line 216, in timeout_func
      logger.debug("terminate function after timeout is exceeded")  # type: ignore
      ^^^^^^
    NameError: name 'logger' is not defined

The exception triggered by this prevents the `p.terminate()` from being
executed. As a result, the processes accumulate in memory (memory leak).

Related: https://github.com/searxng/searx-instances/discussions/708#discussioncomment-13688168
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2025-07-08 08:48:07 +02:00
..
answerers [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
botdetection [fix] sec-fetch-* headers cannot be verified for non-secure requests (#4962) 2025-06-30 13:31:45 +02:00
data [data] update searx.data - update_firefox_version.py (#4954) 2025-06-29 08:17:46 +02:00
enginelib [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
engines [feat] engines: add pixabay for royalty free images/videos 2025-07-05 13:45:19 +02:00
favicons [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
infopage [chore] docs: various grammatical fixes 2025-06-23 23:01:29 +02:00
metrics [fix] openmetrics: value is None if there's no data 2024-11-25 16:57:03 +01:00
network [fix] searx.network: don't trigger DeprecationWarning (#4845) 2025-05-24 12:40:05 +02:00
plugins [fix] calculator plugin: subrocess is not closed on timeout 2025-07-08 08:48:07 +02:00
result_types [mod] weather results: add types, i18n/l10n, symbols & unit conversions 2025-05-31 20:34:59 +02:00
search [mod] data: implement a simple currencies (SQL) database (#4836) 2025-05-25 10:40:57 +02:00
static/themes/simple [upd] web-client (simple): Bump vite from 6.3.5 to 7.0.0 in /client/simple (#4944) 2025-07-04 11:04:22 +02:00
templates/simple [chore] docs: various grammatical fixes 2025-06-23 23:01:29 +02:00
translations [l10n] update translations from Weblate (#4966) 2025-07-04 10:20:18 +02:00
__init__.py [fix] issues when launching a local development server 2025-04-22 14:26:11 +02:00
autocomplete.py [fix] restore startpage autocompleter 2025-06-25 17:38:31 +02:00
babel_extract.py [mod] weather results: add types, i18n/l10n, symbols & unit conversions 2025-05-31 20:34:59 +02:00
cache.py [mod] data: implement a simple tracker URL (SQL) database 2025-06-23 22:12:18 +02:00
compat.py [mod] Revision of the favicon solution 2024-10-05 08:18:28 +02:00
exceptions.py [fix] engine: duckduckgo - CAPTCHA detection 2024-10-19 14:55:44 +02:00
extended_types.py [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
external_bang.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
external_urls.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
flaskfix.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
limiter.py [mod] botdetection: HTTP Fetch Metadata Request Headers 2025-05-04 02:07:26 +02:00
limiter.toml [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
locales.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
openmetrics.py [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
preferences.py [refactor] migrate plugins from "module" to class SXNGPlugin 2025-03-29 10:16:43 +01:00
query.py [mod] internal ! and external !! bangs: ignore upper/lower case 2025-04-24 10:40:18 +02:00
redisdb.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
redislib.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
results.py [refactor] typification of SearXNG (MainResult) / result items (part 2) 2025-03-15 10:36:33 +01:00
searxng.msg [mod] weather results: add types, i18n/l10n, symbols & unit conversions 2025-05-31 20:34:59 +02:00
settings.yml [feat] engines: add pixabay for royalty free images/videos 2025-07-05 13:45:19 +02:00
settings_defaults.py [enh] tidy: clean old morty, filtron, searx references 2025-05-13 10:37:02 +02:00
settings_loader.py [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
sqlitedb.py [chore] fix some docstring typos (#4815) 2025-05-20 21:03:54 +02:00
sxng_locales.py [data] update searx.data - make data.traits (mullvad leta) 2025-04-23 14:06:32 +02:00
unixthreadname.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
utils.py [fix] utils: truncated result (#4949) 2025-06-27 17:52:12 +02:00
version.py [mod] rework container deployment (#4764) 2025-05-11 18:12:51 +02:00
weather.py [feat] wttr.in: migrate to new weather engine template (#4888) 2025-07-03 16:42:13 +02:00
webadapter.py [chore] *: fix typos detected by typos-cli 2024-11-24 12:41:57 +01:00
webapp.py [fix] preferences: description not localized for all UI languages (#4844) 2025-05-23 17:11:41 +02:00
webutils.py [fix] issues when launching a local development server 2025-04-22 14:26:11 +02:00
wikidata_units.py [mod] weather results: add types, i18n/l10n, symbols & unit conversions 2025-05-31 20:34:59 +02:00