Element-0 / ElementZero

Run windows version of BDS in linux with Mod support
GNU General Public License v3.0
273 stars 51 forks source link

Minibus crash and freeze #143

Closed Leandroschwab closed 4 years ago

Leandroschwab commented 4 years ago

First off all Thanks for the amazing software. I'm using minibus to make a queue system connecting two servers. I think i have two distincts problems, first one is an crash that hapens when i close minibus rust server. image image

The second problem freeze the lobby server, it happend to the anarchy server too but is less common. there is no crash report on ez server but on minibus i got this: image

i'm trying to reduce the number of querys per second to see if this is the problem.

Leandroschwab commented 4 years ago

Hi, since last fix "[MiniBus] fix crash when disconnected" i had no more crash, but i still getting server freeze. I was testing elexir minibus to see if it was bestter, and got this debug elixir

back to rust i was running the server and here is an screenshot of my terminal debug busmod

I will work on an script to force this freeze

Leandroschwab commented 4 years ago

I think the bug is related to trying to execute a command while the user is logging in or out of the server, and this is probably the reason that it usually happens more in the lobby server. Using this php script, I can reproduce the freeze. It is just a query with testfor and transferserver to the same server.

`<?php function sendServerCommand($server, $Command,$busip) //envia commando para o server { $errorr =false; echo date("l jS \of F Y h:i:s A") . " sendServerCommand: \n"; $postRequest = $Command; echo 'Server: ' . $server . ' Command: '. $Command; $cURLConnection = curl_init('http://' . $busip . ':8234/map/' . $server . '/execute_command.json'); curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postRequest); curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true); curl_setopt($cURLConnection, CURLOPT_TIMEOUT, 1);

$apiResponse = curl_exec($cURLConnection);
if (curl_errno($cURLConnection)) {
    echo 'Curl error: ' . curl_error($cURLConnection);
    $errorr= true;
}
curl_close($cURLConnection);
echo ' response var_dump: ';
var_dump($apiResponse);
//usleep(50000);
if ($errorr or $apiResponse== ''){
    echo "\nlost Connection with server:". $server . "\n delay \n";
  //sleep(20);

}

// $apiResponse - available data from the API request
return $apiResponse;

}

$busip = "172.20.0.54"; $destserverip = "172.20.0.54 19137"; $lobby = 'lobby2'; $Command = 'testfor @a[tag="joinqueueanarchy"]'; $Command2 = 'transferserver "l5chw4b" ' . $destserverip;

while (true){ $list = json_decode(sendServerCommand($lobby, $Command, $busip), true); $list = json_decode(sendServerCommand($lobby, $Command2, $busip), true); }`

codehz commented 4 years ago

the seconds problem has been addressed, caused by the deadlock it should be easy to fix btw, I don't think use bus to transfer player is a good idea, use script insteads...

plutonium777 commented 4 years ago

Hey! I have a working queue system, pls contact me on Telegram: @wasd_plutonium

Leandroschwab commented 4 years ago

Hi thanks plutonium, but i manage to make mine to work! i'm closing this issue the problem was solved thanks HZ