Open bubnenkoff opened 3 years ago
@bubnenkoff I don't see any trivial bug in the timeout parameter handling. Is there any way you could provide a reproducible code with the related DB setup?
To reproduce you need set long timeout here:
connection = PostgreSQLConnection('localhost', 5432, 'test', username: 'postgres', password: '12345', queryTimeoutInSeconds: 3600); // here
And to try run long request here:
connection.query(sqlQuery) // some long request that run for example 1 minute
In result you will get error:
Future not completed
See code here https://stackoverflow.com/questions/69041494/timeoutexception-on-query-cache-class I found this issue when debug code example above.
@bubnenkoff I'm not able to check this until later, to help the debugging, could you check it at what pg_sleep(<number>)
will throw it an exception?
e.g. connection.query('SELECT 1, pg_sleep(2)')
will likely succeed, how about connection.query('SELECT 1, pg_sleep(31)')
, connection.query('SELECT 1, pg_sleep(61)')
, connection.query('SELECT 1, pg_sleep(601)')
?
I am having the same issue here. It breaks at 30 seconds.
TimeoutException after 0:00:30.000000: Future not completed
I am using both the timeoutInSeconds property, and as I am using futures, I am setting the timeout of the futures to 2 hours.
PostgreSQLConnection omtConnection = PostgreSQLConnection(
config.omt_database!.host!, config.omt_database!.port!, config.omt_database!.databaseName!,
username: config.omt_database!.username,
password: config.omt_database!.password,
useSSL: config.omt_database!.ssl,
allowClearTextPassword: config.omt_database!.allowClearTextPassword,
queryTimeoutInSeconds: 7200
);
var query = await omtConnection.query(getPatientsSql).timeout(Duration(hours: 2));
Everything is in a try catch block, it gets the error, but there is no stack information. Could it be related to any configuration in the server instead of the library?
@isoos if you point me to the right place of the library to narrow the search I can take a look
@pedropastor: the package has moved to a new repository (and new versions). Please use that for further help.
timeoutInSeconds
in:do not work, My code is fall with timeout exception:
Future not compeleted
on long queries.query timeouts sets only if they are setting on connection:
But setting in
connection.query
are should work because: