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

Workers keep getting killed #16

Closed
aspiring-engineer opened this issue Jun 14, 2024 · 13 comments
Closed

Workers keep getting killed #16

aspiring-engineer opened this issue Jun 14, 2024 · 13 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@aspiring-engineer
Copy link

Salut !

Super projet, j'avais fais un script de mon côté mais le tien est carrément plus complet !

Néanmoins j'ai un problème récurrent, soit mes workers se font timeout, soit SIGKILL. J'ai check j'ai largement assez de CPU et de RAM pour le faire fonctionner.
Au delà de ça, j'ai pas mal d'erreurs similaires à #4 alors que j'ai bien tout configuré.

Ma conf:

  yggratio-flaresolverr:
    # DockerHub mirror flaresolverr/flaresolverr:latest
    image: ghcr.io/flaresolverr/flaresolverr:latest
    container_name: yggratio-flaresolverr
    networks:
      yggratio-network:
    environment:
      - LOG_LEVEL=${LOG_LEVEL:-info}
      - LOG_HTML=${LOG_HTML:-false}
      - CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
      - TZ=Europe/Paris
    restart: always

  yggratio-yggproxy:
    image: ghcr.io/limedrive/ygg-rss-proxy:latest
    container_name: yggratio-yggproxy
    networks:
      yggratio-network:
    environment:
        YGG_USER: ${YGG_USER}
        YGG_PASS: ${YGG_PASS}
        RSS_HOST: yggratio-yggproxy
        RSS_PORT: 5000
        RSS_SHEMA: http
        FLARESOLVERR_HOST: yggratio-flaresolverr
        FLARESOLVERR_SHEMA: http
        FLARESOLVERR_PORT: 8191
        GUNICORN_PORT: 5000
        LOG_LEVEL: DEBUG
    restart: always
    depends_on:
        - yggratio-flaresolverr

Exemples de logs:

2024-06-14T19:50:30.011665+0000 INFO ygg_basic_login Successfully authenticated to YGG
2024-06-14T19:50:30.012280+0000 DEBUG ygg_cloudflare_login Session cookies: <CookieJar[<Cookie cf_clearance=XXXX for .ygg.re/>, <Cookie ygg_=XXXXXX for .ygg.re/>]>
2024-06-14T19:50:30.016907+0000 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-14T19:50:35.724742+0000 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&********
[2024-06-14 19:50:39 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:31)
[2024-06-14 19:50:40 +0000] [1] [ERROR] Worker (pid:31) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:50:40 +0000] [35] [INFO] Booting worker with pid: 35
2024-06-14T19:18:31.638570+0000 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&********
[2024-06-14 19:18:36 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:12)
[2024-06-14 19:18:37 +0000] [1] [ERROR] Worker (pid:12) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:18:37 +0000] [17] [INFO] Booting worker with pid: 17
2024-06-14T19:25:55.321712+0000 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
[2024-06-14 19:25:56 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:17)
[2024-06-14 19:25:57 +0000] [1] [ERROR] Worker (pid:17) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:25:57 +0000] [18] [INFO] Booting worker with pid: 18
2024-06-14T19:25:58.414919+0000 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-14T19:26:09.380631+0000 DEBUG _make_request https://www.ygg.re:443 "GET /auth/login HTTP/1.1" 403 None
2024-06-14T19:26:10.356895+0000 INFO ygg_login Cloudflare is enabled, using FlareSolverr
2024-06-14T19:26:11.173063+0000 DEBUG _new_conn Starting new HTTP connection (1): yggratio-flaresolverr:8191
2024-06-14T19:26:11.319947+0000 DEBUG _make_request http://yggratio-flaresolverr:8191 "GET / HTTP/1.1" 200 172
[2024-06-14 19:26:27 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:15)
[2024-06-14 19:26:28 +0000] [1] [ERROR] Worker (pid:15) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:26:28 +0000] [19] [INFO] Booting worker with pid: 19
2024-06-14T19:26:32.999958+0000 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-14T19:26:40.036645+0000 DEBUG _make_request https://www.ygg.re:443 "GET /auth/login HTTP/1.1" 403 None
2024-06-14T19:26:40.447775+0000 INFO ygg_login Cloudflare is enabled, using FlareSolverr
2024-06-14T19:26:40.451967+0000 DEBUG _new_conn Starting new HTTP connection (1): yggratio-flaresolverr:8191
2024-06-14T19:26:40.456729+0000 DEBUG _make_request http://yggratio-flaresolverr:8191 "GET / HTTP/1.1" 200 172
[2024-06-14 19:26:58 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:16)
[2024-06-14 19:26:59 +0000] [1] [ERROR] Worker (pid:16) was sent SIGKILL! Perhaps out of memory?
2024-06-14T19:26:59.736896+0000 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
[2024-06-14 19:27:00 +0000] [20] [INFO] Booting worker with pid: 20
[2024-06-14 19:16:31 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:9)
[2024-06-14 19:16:32 +0000] [1] [ERROR] Worker (pid:9) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:16:32 +0000] [13] [INFO] Booting worker with pid: 13
2024-06-14T19:16:33.035337+0000 DEBUG _get_conn Resetting dropped connection: www.ygg.re
2024-06-14T19:16:33.480692+0000 DEBUG _make_request https://www.ygg.re:443 "GET /auth/login HTTP/1.1" 403 None
2024-06-14T19:16:33.482903+0000 INFO ygg_login Cloudflare is enabled, using FlareSolverr
2024-06-14T19:16:33.485263+0000 DEBUG _new_conn Starting new HTTP connection (1): yggratio-flaresolverr:8191
2024-06-14T19:16:33.490211+0000 DEBUG _make_request http://yggratio-flaresolverr:8191 "GET / HTTP/1.1" 200 172
[2024-06-14 19:17:02 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:8)
[2024-06-14 19:17:02 +0000] [8] [ERROR] Error handling request /rss?action=generate&type=subcat&id=2178&passkey=XXXXX
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 178, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1498, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 878, in full_dispatch_request
    rv = self.preprocess_request()
         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1253, in preprocess_request
    rv = self.ensure_sync(before_func)()
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/ygg_rss_proxy/app.py", line 34, in before_request
    init_session()
  File "/app/ygg_rss_proxy/session_manager.py", line 33, in init_session
    new_session()
  File "/app/ygg_rss_proxy/session_manager.py", line 15, in new_session
    ygg_session = ygg_login()
                  ^^^^^^^^^^^
  File "/app/ygg_rss_proxy/auth.py", line 150, in ygg_login
    return ygg_cloudflare_login(session, ygg_playload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/ygg_rss_proxy/auth.py", line 74, in ygg_cloudflare_login
    response = fs_solver.request_get(url="https://www.ygg.re")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/ygg_rss_proxy/fspy/solver.py", line 198, in request_get
    return self._do_the_work_for_get_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/ygg_rss_proxy/fspy/solver.py", line 157, in _do_the_work_for_get_post
    response = self.req_session.post(self.flare_solverr_url, json=payload)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 537, in _make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 466, in getresponse
    httplib_response = super().getresponse()
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/http/client.py", line 1395, in getresponse
    response.begin()
  File "/usr/local/lib/python3.11/http/client.py", line 325, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/http/client.py", line 286, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 203, in handle_abort
    sys.exit(1)
SystemExit: 1
[2024-06-14 19:17:03 +0000] [8] [INFO] Worker exiting (pid: 8)
[2024-06-14 19:17:03 +0000] [1] [ERROR] Worker (pid:8) was sent SIGKILL! Perhaps out of memory?
[2024-06-14 19:17:03 +0000] [14] [INFO] Booting worker with pid: 14

Bref, une fois sur deux les requêtes ne passent pas. Merci pour le coup de main !

@LimeDrive LimeDrive self-assigned this Jun 14, 2024
@LimeDrive LimeDrive added the bug Something isn't working label Jun 14, 2024
@LimeDrive LimeDrive linked a pull request Jun 14, 2024 that will close this issue
@LimeDrive
Copy link
Owner

Bonjour,

  • J'ai augmenté le timeout de GUnicorn, comme ça on verra ce que ça donne.
  • Voir le docker-compose avec ta configuration, j'ai rajouté un expose du port 5000 étant donné que tu n'utilise pas celui du conteneur par défaut. J'ai aussi mappé le dossier config de l'intérieur du conteneur. Car la base de données est dans le container avec ta configuration , c'est possible que ce soit ça qui provoque le timeout. Donc soit on la met dans un volume, soit tu la mets sur ton système comme dans l'exemple.
  • J'ai aussi changé l'image sur :develop Tu bénéficieras des derniers fixes, notamment vis-à-vis de la base de données et du log qui est maintenant totalement offusqué. ( cookies, pass, id, passkey )
version: '3.8'

services:

  yggratio-flaresolverr:
    image: ghcr.io/flaresolverr/flaresolverr:latest
    container_name: yggratio-flaresolverr
    networks:
      - yggratio-network
    environment:
      LOG_LEVEL: ${LOG_LEVEL:-info}
      LOG_HTML: ${LOG_HTML:-false}
      CAPTCHA_SOLVER: ${CAPTCHA_SOLVER:-none}
      TZ: Europe/Paris
    restart: always

  yggratio-yggproxy:
    image: ghcr.io/limedrive/ygg-rss-proxy:develop
    container_name: yggratio-yggproxy
    expose:
      - 5000
    volumes:
      - ./config:/app/config
    environment:
      TZ: Europe/Paris
      YGG_USER: ${YGG_USER}
      YGG_PASS: ${YGG_PASS}
      RSS_HOST: yggratio-yggproxy
      RSS_PORT: 5000
      FLARESOLVERR_HOST: yggratio-flaresolverr
      GUNICORN_PORT: 5000
      LOG_LEVEL: DEBUG
    networks:
      - yggratio-network
    restart: always
    depends_on:
      - yggratio-flaresolverr

l'image devrait être déployée d'ici quelques minutes

@LimeDrive LimeDrive reopened this Jun 15, 2024
@aspiring-engineer
Copy link
Author

aspiring-engineer commented Jun 15, 2024

Même problème qu'avant. J'ai update ma conf avec ce que tu m'as donné.
Pendant quelques minutes ça fonctionne correctement mais au bout d'un moment les workers commettent sepuku.

Merci d'avoir mis un peu d'ordre dans les logs

/usr/local/lib/python3.11/site-packages/pydantic_settings/sources.py:431: UserWarning: directory "/run/secrets" does not exist
  warnings.warn(f'directory "{self.secrets_path}" does not exist')
2024-06-15T11:01:59.332921+0200 INFO <module> ----------------------------------------------------------
2024-06-15T11:01:59.363496+0200 INFO <module> Checking directories...
2024-06-15T11:01:59.363896+0200 INFO <module> ----------------------------------------------------------
2024-06-15T11:01:59.364397+0200 INFO <module> Directory /app/config already exists.
2024-06-15T11:01:59.364974+0200 INFO <module> Directory /app/config already exists.
2024-06-15T11:01:59.365401+0200 INFO <module> Directory /app/config/logs already exists.
2024-06-15T11:01:59.365715+0200 INFO <module> ----------------------------------------------------------
2024-06-15T11:01:59.366011+0200 INFO <module> Starting ygg_rss_proxy on http://yggratio-yggproxy:5000
2024-06-15T11:01:59.366328+0200 INFO <module> ----------------------------------------------------------
[2024-06-15 11:01:59 +0200] [1] [INFO] Starting gunicorn 22.0.0
[2024-06-15 11:01:59 +0200] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2024-06-15 11:01:59 +0200] [1] [INFO] Using worker: sync
[2024-06-15 11:01:59 +0200] [8] [INFO] Booting worker with pid: 8
[2024-06-15 11:01:59 +0200] [9] [INFO] Booting worker with pid: 9
[2024-06-15 11:01:59 +0200] [10] [INFO] Booting worker with pid: 10
[2024-06-15 11:02:00 +0200] [11] [INFO] Booting worker with pid: 11
2024-06-15T11:02:06.421657+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:02:06.925163+0200 DEBUG _make_request https://www.ygg.re:443 "GET /auth/login HTTP/1.1" 403 None
2024-06-15T11:02:06.933708+0200 INFO ygg_login Cloudflare is enabled, using FlareSolverr
2024-06-15T11:02:06.935332+0200 DEBUG _new_conn Starting new HTTP connection (1): yggratio-flaresolverr:8191
2024-06-15T11:02:06.965338+0200 DEBUG _make_request http://yggratio-flaresolverr:8191 "GET / HTTP/1.1" 200 172
2024-06-15T11:02:20.814279+0200 DEBUG _make_request http://yggratio-flaresolverr:8191 "POST /v1 HTTP/1.1" 200 10701
2024-06-15T11:02:20.861659+0200 DEBUG ygg_cloudflare_login FlareSolverr response: XXXX
2024-06-15T11:02:20.865645+0200 DEBUG _get_conn Resetting dropped connection: www.ygg.re
2024-06-15T11:02:20.950557+0200 DEBUG _make_request https://www.ygg.re:443 "POST /auth/process_login HTTP/1.1" 200 None
2024-06-15T11:02:20.952853+0200 INFO ygg_basic_login Successfully authenticated to YGG
2024-06-15T11:02:20.953542+0200 DEBUG ygg_cloudflare_login Session cookies: <CookieJar[<Cookie **<REDACTED>** for .ygg.re/>, <Cookie **<REDACTED>** for .ygg.re/>]>
2024-06-15T11:02:20.958350+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:02:21.365944+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:02:22.374037+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:02:22.720855+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
[...]
2024-06-15T11:33:12.798049+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:33:24.835409+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:35:20.320732+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:35:30.689643+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:35:42.372414+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:35:42.640646+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
[2024-06-15 11:35:41 +0200] [1] [CRITICAL] WORKER TIMEOUT (pid:9)
[2024-06-15 11:35:45 +0200] [9] [INFO] Worker exiting (pid: 9)
2024-06-15T11:36:19.914420+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:36:20.309751+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:36:21.419976+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:36:21.822750+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:36:22.478713+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:36:22.624567+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:36:24.004162+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:36:24.134861+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
[2024-06-15 11:37:15 +0200] [1] [ERROR] Worker (pid:9) exited with code 1
[2024-06-15 11:37:15 +0200] [1] [ERROR] Worker (pid:9) exited with code 1.
[2024-06-15 11:37:19 +0200] [12] [INFO] Booting worker with pid: 12
2024-06-15T11:42:06.729143+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:42:08.304125+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:42:09.568132+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:42:09.924553+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:42:10.769172+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:42:10.869024+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:42:11.573515+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:42:11.933795+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:52:06.984448+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:52:07.376910+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:52:57.409810+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:52:59.596259+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:53:06.144412+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:53:06.381583+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T11:53:07.875194+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T11:53:07.953519+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
[2024-06-15 11:55:10 +0200] [1] [CRITICAL] WORKER TIMEOUT (pid:12)
2024-06-15T11:55:11.781279+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
[2024-06-15 11:55:12 +0200] [1] [ERROR] Worker (pid:12) was sent SIGKILL! Perhaps out of memory?
2024-06-15T11:55:12.274541+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss/download?id=1188432&**<REDACTED>** HTTP/1.1" 200 111412
[2024-06-15 11:55:13 +0200] [13] [INFO] Booting worker with pid: 13

@LimeDrive
Copy link
Owner

Je n'arrive pas à reproduire, même en bastonnant les workers sur les même requêtes en simultané.
https://gist.github.com/LimeDrive/fbfd8ef4acb0222723a0a57f53d25813

Ça a l'air d'être assez lié au système quand même. Peux-tu me donner les détails de ton système sur lequel est le container ? que je vois dans les prochains jours à monter une machine avec les mêmes specs.

Par ailleurs, on peut aussi essayer de réduire de moitié le nombre de workers. en ajoutant la variables d'environnement :
GUNICORN_WORKERS: 2

j'ai poussé ce matin un update de l'image :latest sur la #18

@aspiring-engineer
Copy link
Author

aspiring-engineer commented Jun 15, 2024

C'est un dédié: Intel X3440 4c/8t 2.53GHz, 8 Go ram, 8To HDD.
C'est du vieux matériel et c'est pas dingue en perf mais ça devrait tourner, surtout qu'htop me remonte une utilisation assez minime du système.

Je vais essayer de monter le timeout on va voir si ça tient mieux.

@LimeDrive
Copy link
Owner

Le time out est déjà sur 2 minutes. Donc c'est qu'il y a soit une fonction qui bloque quelque part, soit un problème au niveau du système.
Tu pourras pull la:develop dans quelques minutes. J'ai ajouté des exceptions par timeout dans le code afin d'essayer d'identifier se qui fait crash les worker.
Je ferai les tests dans la semaine sur une machine à peu près comme la tienne pour voir si ça vient de là.

@LimeDrive LimeDrive added the Info needed informations needed label Jun 15, 2024
@LimeDrive LimeDrive pinned this issue Jun 15, 2024
@aspiring-engineer
Copy link
Author

Pour information, j'ai 4 flux RSS différents pour YGG.
Visiblement ça a l'air de venir de sqlalchemy, sqlite db locked:

2024-06-15T13:27:10.152827+0200 INFO <module> ----------------------------------------------------------
2024-06-15T13:27:10.154821+0200 INFO <module> Checking directories...
2024-06-15T13:27:10.155371+0200 INFO <module> ----------------------------------------------------------
2024-06-15T13:27:10.156213+0200 INFO <module> Directory /app/config already exists.
2024-06-15T13:27:10.156848+0200 INFO <module> Directory /app/config already exists.
2024-06-15T13:27:10.157426+0200 INFO <module> Directory /app/config/logs already exists.
2024-06-15T13:27:10.157944+0200 INFO <module> ----------------------------------------------------------
2024-06-15T13:27:10.158465+0200 INFO <module> Starting ygg_rss_proxy on http://yggratio-yggproxy:5000
2024-06-15T13:27:10.158998+0200 INFO <module> ----------------------------------------------------------
2024-06-15T13:27:25.460459+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:25.460464+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:25.461915+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:25.509893+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:25.684453+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:25.686829+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:26.018540+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:26.282157+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:26.451230+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:26.913070+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:27.310752+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:27.355261+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:27.391313+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:27.673553+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:28.066382+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:28.147057+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:28.622081+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:29.014057+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:29.068984+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:29.390727+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:29.460445+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:29.543456+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:30.069073+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:30.504116+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:30.508007+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:30.941139+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:31.014563+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:31.184596+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:32.012376+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:32.112322+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:32.583261+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:32.986299+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:33.364092+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:33.835741+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:34.236129+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:34.321790+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:34.954435+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:35.047807+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:36.444315+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:36.456848+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:36.785650+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:36.807511+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:37.049795+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:37.134444+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:37.149934+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:37.176870+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:37.456357+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:37.904056+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:37.910911+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:38.329926+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:38.592753+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:38.679137+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:39.169313+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:39.251853+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:39.537948+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:39.968644+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:40.608960+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:40.712385+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:41.175284+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:41.599911+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:41.849521+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:41.851720+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:41.948059+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:42.220693+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:42.335599+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:42.435843+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:43.212458+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:43.292269+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:44.114786+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:44.561615+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:44.576998+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:44.585693+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:44.917116+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:44.951606+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:45.211900+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:45.218077+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:45.349598+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:45.447600+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:45.821124+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:46.175931+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:46.213648+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:46.496052+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:47.405622+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:47.506297+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:48.777991+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:48.898470+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:49.843695+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:50.223281+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:50.489713+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:50.812518+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:51.121749+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:51.224923+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:51.840847+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:51.932153+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:52.284212+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:52.672835+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:52.816988+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:53.194909+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:53.204201+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:53.298025+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:53.752039+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:53.838807+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:54.301783+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:54.726511+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:55.056959+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:55.386152+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:55.440113+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:55.525187+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:55.825972+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:55.919116+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:56.403707+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:56.803258+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:57.348912+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:57.679475+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:58.443228+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:58.523708+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:27:59.429059+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:27:59.809235+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:00.199868+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:00.225901+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:00.551463+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:00.563627+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:00.791499+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:00.887331+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:01.302776+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:01.394986+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:01.932670+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:02.376424+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:03.707348+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:04.063757+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:04.583165+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:04.672767+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:28:05.549772+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:28:05.635811+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:37.025505+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:37.092452+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:37.101298+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:37.104636+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:37.407015+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:37.676461+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:37.696760+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:37.720236+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:37.954142+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:38.343016+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:38.630637+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:38.958562+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:39.208673+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:39.319824+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:39.474590+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:39.557783+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:40.021498+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:40.305459+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:40.420120+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:40.625684+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:40.696169+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:40.730958+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:40.934579+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:41.045505+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:41.421506+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:41.805321+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:41.947833+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:42.267632+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:42.371257+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:42.453940+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:43.055811+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:43.164065+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:43.856741+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:44.234195+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:44.355409+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:42.766198+0200 ERROR wrapper Exception when querying database ((sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)).Retrying (1/3) in 0.30s.
[...]
OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2024-06-15T13:29:44.682232+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:44.979999+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:45.130427+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:45.637755+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:45.797803+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:46.161164+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:46.581443+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:46.591072+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:46.918836+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:47.475919+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:47.573219+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:48.073286+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:48.160023+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:49.386052+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:49.836477+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:49.871793+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:49.723891+0200 ERROR wrapper Exception when querying database ((sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)).Retrying (1/3) in 0.30s.

[...]

OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2024-06-15T13:29:50.218694+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:50.743149+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:50.836829+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:51.846796+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:29:51.924057+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:29:52.354960+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:02.252160+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:02.340986+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:30:02.805574+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:02.908161+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:30:03.859355+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:04.444923+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2179&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:30:04.562607+0200 ERROR wrapper Exception when querying database ((sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)).Retrying (1/3) in 0.30s.

[...]

OperationalError: (sqlite3.OperationalError) database is locked
[SQL: SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry 
FROM sessions 
WHERE sessions.session_id = ?
 LIMIT ? OFFSET ?]
[parameters: ('session:XXXX', 1, 0)]
(Background on this error at: https://sqlalche.me/e/20/e3q8)
2024-06-15T13:30:06.175596+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:06.522706+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2178&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:30:07.251816+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:07.336580+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2183&**<REDACTED>** HTTP/1.1" 200 None
2024-06-15T13:30:07.884477+0200 DEBUG _new_conn Starting new HTTPS connection (1): www.ygg.re:443
2024-06-15T13:30:07.973616+0200 DEBUG _make_request https://www.ygg.re:443 "GET /rss?action=generate&type=subcat&id=2184&**<REDACTED>** HTTP/1.1" 200 None

@LimeDrive
Copy link
Owner

Ha c'est peut être de l'IO's sur HDD pour la db. Du coup normalement c'est pas bien grave, sa vas levé une exception c'est tout. Tu n'a pas de worker kill par contre ici.

j'ai 4 flux RSS différents pour YGG

oui j'ai fait les test avec 8 Flux appelé en même temps en reprenant tes subcat, et je ne rencontre pas le souci, mais sur ARM et une machine récente et puissante, donc pas comparable.

Je reprendrai les test dans quelque jours.

@aspiring-engineer
Copy link
Author

Non parce que j'ai fais le test rapidement, mais je pense qu'au bout de quelques minutes le worker ayant eu le problème de co à la DB se kill et se redémarre.

C'est quand même un peu pénible, ça veut dire que de temps en temps les refresh vont pas fonctionner et faudra attendre la prochaine tentative. Sur un délais de 5 minutes ça va, mais sur 1h ça fait long la tentative.

Pas possible d'implémenter un petit jitter qui rajoute 3 secondes de wait entre chaque request ? L'utilisateur final s'en rendra pas compte et ça permet aux systèmes plus lents de suivre.

LimeDrive added a commit that referenced this issue Jun 15, 2024
@LimeDrive
Copy link
Owner

Ok, je vois.

Mettre un jitter sur les requêtes n'est pas forcément pertinent étant donné qu'elles seront décalées tout en même temps à part à faire du random.

Sachant maintenant d'où vient le problème des workers qui se kill. J'ai mis un rétry sur les fonctions et une exclusion de l'erreur. Donc normalement, sa aura le même effet.

Alors j'ai pu tester personnellement en ddos mon instance. Pour avoir une remonté d'erreur. Ça a l'air concluant.

Comme d'habitude, le fix et poussé sur la « :develop ». Je te laisse tester et me confirmer si le problème est résolu. Ensuite je ferai un update de l'image de base.

@aspiring-engineer
Copy link
Author

J'ai pas l'impression que tu aies push la dernière version sur develop, pas d'update selon github depuis 2h et j'ai toujours les mêmes erreurs.

@LimeDrive
Copy link
Owner

C'est bien push en auto par le ci quand j'ai commit sur la branche dev. Donc c'est que cela n' a pas fonctionné pour toi.
A chaque fois il faudra faire un docker compose pull pour récup les nouvelle image. Je vais mettre un versioning dans le logs pour que je puisse vérifier que l'on est bien sur la bonne image develop a chaque fois.
Je n' ai pas réussi à reproduire de lock mais une IO error avec la db. Et il m'a fallu envoyer plus d' une centaine de requêtes en simultané pour l'avoir et c'est fix avec se que j'ai push.
Franchement je ne sais pas se qui bloque chez toi, donc il va falloir que j'essaie sur VM avec différents config pour reproduire et debug. Vu le log de ton côté, l'exception ne passe pas par le prasser que j'ai mis en place c'est qu'elle sort directement de flask_session je suppose.
J'essaierai de lisser au max tout les appels db et la gestion des erreurs se soir en plus des ajustements.

@LimeDrive LimeDrive added enhancement New feature or request help wanted Extra attention is needed and removed Info needed informations needed labels Jun 15, 2024
LimeDrive added a commit that referenced this issue Jun 15, 2024
LimeDrive added a commit that referenced this issue Jun 15, 2024
Fix: Workers keep getting killed #16
@LimeDrive
Copy link
Owner

LimeDrive commented Jun 15, 2024

Bon je pousse une dernière tentative pour se soir afin de réglé ton souci.
Ajoute un timeout plus conséquent sur la base de données. De mon côté, même quand je force le test, Je n'ai plus aucune erreur. je n'ai réussi à la reproduire qu'une seule fois et là maintenant je n'y arrive plus.
ça va être mis directement sur la développe donc docker compose pull obligatoire. Il y a maintenant le numéro de version dans le log. le fixe et sur la 1.2.11 à bien vérifier quand tu lances ton conteneur.

Voici une vidéo du forcing sans résolution pour éviter de me faire taper sur les doigts car je ne suis pas certain que le site d'YGG apprécie mdr. Tu vois que de mon côté, ça tient quand même très bien.

Monosnap.screencast.2024-06-15.23-33-04.mp4

LimeDrive added a commit that referenced this issue Jun 15, 2024
Fix Logs session offuscation in exception #16
@aspiring-engineer
Copy link
Author

J'ai refais des tests et ça a l'air de tenir, merci pour les updates !

Je réouvrirai une issue si jamais le problème revient.

@LimeDrive LimeDrive unpinned this issue Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants