jpdillingham / Soulseek.NET

A .NET Standard client library for the Soulseek network.
GNU General Public License v3.0
177 stars 23 forks source link

Add a configuration setting to limit the number of search requests in flight, and begin dropping incoming requests if the limit is reached #758

Closed jpdillingham closed 2 years ago

jpdillingham commented 2 years ago

This functionality probably should have been added along with the search request handling logic initially.

If a client is slow to respond to requests (running on low spec hardware, inefficient search matching, etc), it is possible for the average time to service an incoming search request to exceed the average rate at which searches are received. When this happens, the number of search requests will steadily climb until the application crashes.

Rather than allowing this to happen, this library should begin dropping incoming search requests. A warning should be logged so that users know it is happening.

jpdillingham commented 2 years ago

Code that implements this library can easily handle this logic itself. You could argue (and be correct) that the need to do so will not be obvious, but dropping incoming requests won't be obvious either and I think that's the greater of two evils.