in03 / proxima

Transcode source media directly from DaVinci Resolve using multiple machines for encoding. Great for creating proxies quickly.
MIT License
53 stars 3 forks source link

Divide by zero error in queuer progress #208

Closed in03 closed 2 years ago

in03 commented 2 years ago

Queuer crashes with a divide by zero error when working queuing lots of proxies. Looks like the discrete progress (total task progress) reaches completion well before all proxies have finished.

│ C:\Users\Caleb\.local\pipx\venvs\resolve-proxy-encoder\lib\site-packages\resolve_proxy_encoder\a │
│ pp\broker.py:312 in report_progress                                                              │
│                                                                                                  │
│   309 │   │   │   │   │   self.handle_task_event(te)                                             │
│   310 │   │   │   │                                                                              │
│   311 │   │   │   │   for pe in progress_events:                                                 │
│ ❱ 312 │   │   │   │   │   self.handle_task_progress(pe)                                          │
│   313 │   │   │   │                                                                              │
│   314 │   │   │   │   # Let's be nice to the server ;)                                           │
│   315 │   │   │   │   time.sleep(loop_delay)                                                     │
│                                                                                                  │
│ C:\Users\Caleb\.local\pipx\venvs\resolve-proxy-encoder\lib\site-packages\resolve_proxy_encoder\a │
│ pp\broker.py:258 in handle_task_progress                                                         │
│                                                                                                  │
│   255 │   │   │   try:                                                                           │
│   256 │   │   │   │   total_task_average = round(                                                │
│   257 │   │   │   │   │   active_task_average                                                    │
│ ❱ 258 │   │   │   │   │   / (len(self.callable_tasks) - self.completed_tasks)                    │
│   259 │   │   │   │   )                                                                          │
│   260 │   │   │   except DivisionByZero:                                                         │
│   261 │   │   │   │   total_task_average = 0

self.completed_tasks must be decrementing faster than it should be for some reason? May be the task handler is running multiple times for the same messages? Better check the checksums are working properly.

in03 commented 2 years ago

Pushed a hotfix straight to main. Fixed in 0db715559707c6c99a641e38d3a6fa1fffad1652.