Skip to content

Commit

Permalink
Try to fix the flood ban bug by sleeping for floodRate after connecting
Browse files Browse the repository at this point in the history
There have been issues where the server would flood ban queries shortly
after connecting (after roughly 10 commands). However, if they didn't
get banned at the start, the query would run fine at a 350ms/command
rate indefinitely. Adding a startup delay should thus fix the issue.

Users of the UNLIMITED flood rate are unaffected by this change.
  • Loading branch information
rogermb committed Apr 29, 2018
1 parent f4f2443 commit 1861530
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public SocketWriter(QueryIO io, TS3Config config) throws IOException {
@Override
public void run() {
try {
// Initial sleep to prevent flood ban shortly after connecting
if (floodRate > 0) Thread.sleep(floodRate);

while (!isInterrupted()) {
final Command c = sendQueue.take();
final String msg = c.toString();
Expand Down

0 comments on commit 1861530

Please sign in to comment.