Skip to content

Commit

Permalink
Fixed unexpected deletion of log files of other processes that led to…
Browse files Browse the repository at this point in the history
… OSError: [Errno 116] Stale file handle error on NFS volumes (cvat-ai#8121)

Due the nocleanup option defaults to false and we use AUTO-generated
names for backend process log files, this causes NFS4ERR_STALE to appear
on NFS-mounted volumes
```python
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 109, in emit
    self.flush()
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 68, in flush
    self.stream.flush()
OSError: [Errno 116] Stale file handle
```

http://supervisord.org/configuration.html#:~:text=Introduced%3A%203.0-,nocleanup,-Prevent%20supervisord%20from

https://stackoverflow.com/questions/40262823/stale-file-handle-error-when-process-trying-read-the-file-that-other-process

Co-authored-by: Roman Donchenko <roman@cvat.ai>
  • Loading branch information
azhavoro and SpecLad authored Jul 9, 2024
1 parent a68fe01 commit ad1bcd5
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
11 changes: 11 additions & 0 deletions changelog.d/20240708_103153_andrey_fix_logger_error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Fixed

- Fixed unexpected deletion of log files of other processes that led to OSError:
\[Errno 116\] Stale file handle error on NFS volumes
(<https://github.com/cvat-ai/cvat/pull/8121>)

### Changed

- Log files for individual backend processes are now stored in ephemeral
storage of each backend container rather than in the `cvat_logs` volume
(<https://github.com/cvat-ai/cvat/pull/8121>)
1 change: 0 additions & 1 deletion supervisord/server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:clamav_update]
startsecs=0
Expand Down
2 changes: 1 addition & 1 deletion supervisord/utils.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqscheduler]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand All @@ -32,6 +31,7 @@ command=%(ENV_HOME)s/wait_for_deps.sh
--worker-class cvat.rqworker.DefaultWorker
environment=VECTOR_EVENT_HANDLER="SynchronousLogstashHandler",CVAT_POSTGRES_APPLICATION_NAME="cvat:worker:notifications"
numprocs=1
autorestart=true

[program:rqworker-cleaning]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down
1 change: 0 additions & 1 deletion supervisord/worker.analytics_reports.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-analytics-reports]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down
1 change: 0 additions & 1 deletion supervisord/worker.annotation.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-annotation]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down
1 change: 0 additions & 1 deletion supervisord/worker.export.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-export]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down
2 changes: 0 additions & 2 deletions supervisord/worker.import.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-import]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand All @@ -26,7 +25,6 @@ numprocs=%(ENV_NUMPROCS)s
process_name=%(program_name)s-%(process_num)d
autorestart=true


[program:clamav-update]
command=bash -c "if [ \"${CLAM_AV}\" = 'yes' ]; then /usr/bin/freshclam -d \
-l %(ENV_HOME)s/logs/freshclam.log --foreground=true; fi"
Expand Down
1 change: 0 additions & 1 deletion supervisord/worker.quality_reports.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-quality-reports]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down
1 change: 0 additions & 1 deletion supervisord/worker.webhooks.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=debug ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/ ; where child log files will live

[program:rqworker-webhooks]
command=%(ENV_HOME)s/wait_for_deps.sh
Expand Down

0 comments on commit ad1bcd5

Please sign in to comment.