Raised This Month: $51 Target: $400
 12% 

SQL_MakeDbTuple Timeout parameter not respected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-02-2019 , 20:00   SQL_MakeDbTuple Timeout parameter not respected
Reply With Quote #1

Hi, i'm having troubles with SQL_MakeDbTuple function:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>

new Handle:g_SqlTuple;
new 
Handle:g_SqlConnection;

public 
plugin_init()
{
    
register_plugin("Sqlx test",AMXX_VERSION_STR,"SmileY");
    
    
g_SqlTuple SQL_MakeDbTuple("google.com","root","","test",1); // Any address to test it
    
    
if(g_SqlTuple != Empty_Handle)
    {
        new 
ErrorCode,Error[32];
        
g_SqlConnection SQL_Connect(g_SqlTuple,ErrorCode,Error,charsmax(Error));
        
        if(
g_SqlConnection == Empty_Handle)
        {
            
set_fail_state("[%i] %s",ErrorCode,Error);
        }
    }
}

public 
plugin_end()
{
    
SQL_FreeHandle(g_SqlTuple);
    
SQL_FreeHandle(g_SqlConnection);

This code try to connect to a remote mysql host (In this case with a wrong address to test it!)
The server just do not respect timeout parameter (It respect only from core.ini).

In this test code the server will wait 60 seconds from mysql_timeout (at core.ini), not just 1 second from SQL_MakeDbTuple.

Ps. All crap from console (It is a local test)

Code:
] meta list
Currently loaded plugins:
      description      stat pend  file              vers      src   load  unlod
 [ 1] AMX Mod X        RUN   -    amxmodx_mm.dll    v1.9.0.5  ini   Start ANY  
 [ 2] CStrike          RUN   -    cstrike_amxx.dll  v1.9.0.5  pl1   ANY   ANY  
 [ 3] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.9.0.5  pl1   ANY   ANY  
 [ 4] FakeMeta         RUN   -    fakemeta_amxx.dl  v1.9.0.5  pl1   ANY   ANY  
 [ 5] CSX              RUN   -    csx_amxx.dll      v1.9.0.5  pl1   ANY   ANY  
 [ 6] MySQL            RUN   -    mysql_amxx.dll    v1.9.0.5  pl1   ANY   ANY  
6 plugins, 6 running
] amxx plugins
Currently loaded plugins:
       name                    version     author            file             status   
 [  1] Pug Mod (Anti Flood)    1.9.0.5263  AMXX Dev Team     PugFlood.amxx    running  
 [  2] Pug Mod (Core)          3.0.2       SmileY            PugCore.amxx     running  
 [  3] Pug Mod (Config System  3.0.2       SmileY            PugConfigs.amxx  running  
 [  4] Pug Mod (Menus System)  3.0.2       SmileY            PugMenus.amxx    running  
 [  5] Pug Mod (Ready System)  3.0.2       SmileY            PugReady.amxx    running  
 [  6] Pug Mod (LO3)           3.0.2       SmileY            PugLO3.amxx      running  
 [  7] Pug Mod (Aux)           3.0.2       SmileY            PugAux.amxx      running  
 [  8] Pug Mod (Warmup)        3.0.2       SmileY            PugWarmup.amxx   running  
 [  9] Pug Mod (Manager)       1.9.0.5263  SmileY            PugAdmin.amxx    running  
 [ 10] Pug Mod (Stats)         3.0.2       SmileY            PugStats.amxx    debug    
 [ 11] Logs Parser             1.9.0.5263  SmileY            File.amxx        error    
( 11) Error: [2003] Can't connect to MySQL server o
11 plugins, 10 running
] amxx version
AMX Mod X 1.9.0.5263 (http://www.amxmodx.org)
Authors:
	David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
	Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
	Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
	Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Oct 27 2019 16:23:56
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0a
Build ID: 5263:15a14a0a
Core mode: JIT+ASM32
] meta list
Currently loaded plugins:
      description      stat pend  file              vers      src   load  unlod
 [ 1] AMX Mod X        RUN   -    amxmodx_mm.dll    v1.9.0.5  ini   Start ANY  
 [ 2] CStrike          RUN   -    cstrike_amxx.dll  v1.9.0.5  pl1   ANY   ANY  
 [ 3] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.9.0.5  pl1   ANY   ANY  
 [ 4] FakeMeta         RUN   -    fakemeta_amxx.dl  v1.9.0.5  pl1   ANY   ANY  
 [ 5] CSX              RUN   -    csx_amxx.dll      v1.9.0.5  pl1   ANY   ANY  
 [ 6] MySQL            RUN   -    mysql_amxx.dll    v1.9.0.5  pl1   ANY   ANY  
6 plugins, 6 running
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-03-2019 , 01:40   Re: SQL_MakeDbTuple Timeout parameter not respected
Reply With Quote #2

What? timeout will work when a connection got established its length of a connection, during that time you can do some queries.0

Edit: this is actually wrong time out is the time until the server stop trying to connect to the DB, it connection cant be reached.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-01-2021 at 12:16.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-03-2019 , 13:57   Re: SQL_MakeDbTuple Timeout parameter not respected
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
What? timeout will work when a connection got established its length of a connection, during that time you can do some queries.
so why server get's freeze at SQL_Connect? It is a bug or something?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode