aaron-iles / ultra_tracker

A personal tracker for ultrarunners.
0 stars 0 forks source link

Application hangs indefinitely when uwsgi worker restarts #44

Open aaron-iles opened 1 month ago

aaron-iles commented 1 month ago

I'm not sure why this is happening (and why it is happening now) but when the max-requests number is hit and uwsgi restarts a worker the app hangs forever. Below are things from the log that could be indicative of problems.

This is what the log looks like when I set the max-requests to something small like 10 and reload the page 11 times.

Sep 07 13:13:57 ultra-tracker docker[1977]: ultra-tracker  | ...The work of process 10 is done. Seeya!
Sep 07 13:13:57 ultra-tracker docker[1977]: ultra-tracker  | worker 1 killed successfully (pid: 10)
Sep 07 13:13:57 ultra-tracker docker[1977]: ultra-tracker  | Respawned uWSGI worker 1 (new pid: 20)

This was found back in the logs around the time the app had problems during a race.

Sep 05 21:07:02 ultra-tracker docker[1977]: ultra-tracker  | Fri Sep  6 01:07:02 2024 - uwsgi_response_write_body_do(): Connection reset by peer [core/writer.c line 341] during GET / (10.0.0.206)
Sep 05 21:07:02 ultra-tracker docker[1977]: ultra-tracker  | OSError: write error

This was the state it was in before it needed a reboot.

Sep 08 18:45:20 ultra-tracker docker[839]: ultra-tracker  | ...The work of process 11 is done. Seeya!
Sep 08 18:45:21 ultra-tracker docker[839]: ultra-tracker  | worker 1 killed successfully (pid: 11)
Sep 08 18:45:21 ultra-tracker docker[839]: ultra-tracker  | Respawned uWSGI worker 1 (new pid: 327)
Sep 08 20:09:03 ultra-tracker docker[839]: ultra-tracker  | Mon Sep  9 00:09:03 2024 - *** uWSGI listen queue of socket "0.0.0.0:8080" (fd: 3) full !!! (100/100) ***
Sep 08 20:09:04 ultra-tracker docker[839]: ultra-tracker  | Mon Sep  9 00:09:04 2024 - *** uWSGI listen queue of socket "0.0.0.0:8080" (fd: 3) full !!! (100/100) ***
Sep 08 20:09:05 ultra-tracker docker[839]: ultra-tracker  | Mon Sep  9 00:09:05 2024 - *** uWSGI listen queue of socket "0.0.0.0:8080" (fd: 3) full !!! (100/100) ***
Sep 08 20:09:06 ultra-tracker docker[839]: ultra-tracker  | Mon Sep  9 00:09:06 2024 - *** uWSGI listen queue of socket "0.0.0.0:8080" (fd: 3) full !!! (100/100) ***
...
aaron-iles commented 1 month ago

I'm wondering if this is an issue with having the application keeping everything in memory rather than fetching data when requested.