scorelab / Bassa

Automated Download Queue for Communities to take the best use of Internet bandwidth
GNU General Public License v3.0
168 stars 493 forks source link

Fix Server errors for download and compression feature and other required fixes #918

Closed kmehant closed 4 years ago

kmehant commented 4 years ago

Description

There some serious server errors while making downloads and usually the server goes down due to improper concurrency. I have made required fixes as follows

  1. Updated base image to use alpine latest for Aria2c due to support issues
  2. Resolved MySQL exceptions and type errors and added logging
  3. Removed pool size restriction for now
  4. Increased max_bandwidth and size_limit for downloads as users are restricted after downloading a few KB of data.
  5. Corrected URL endpoints for start and kill downloads
  6. According to the previous model for every start request, a new process is being spawned creating problems with huge concurrency giving out various problems. I reformed the model to have always a single process for download daemon with 5 worker threads to download to the max of five files at a time concurrently.
  7. Fixed the Compression feature and now we can have downloads and compression feature working \0/

Related Issue

Motivation and Context

This is required for the proper functioning of the server.

How Has This Been Tested?

This has been tested locally and it's working fine now.

Types of changes

Checklist:

kmehant commented 4 years ago

@JaDogg I fixed most of them the one which is there is according to the previous code practice :)

kmehant commented 4 years ago

@JaDogg and also Travis is failing because the log limit is being crossed. So will work on some workaround for this in my next pull request :)

JaDogg commented 4 years ago

@kmehant Need 1 more review to merge :)

kmehant commented 4 years ago

@kmehant Need 1 more review to merge :)

@jadogg I cannot approve my own PR 😫 We might need to reduce threshold to 1 or might need some other to approve as well.

agentmilindu commented 4 years ago

Problem solved!

JaDogg commented 4 years ago

Merged :)