SCM

[#1011238] NOTICE breaks CommandTimeout Support

View Trackers | Bugs | Download .csv | Monitor

Date:
2012-09-26 11:10
Priority:
3
State:
Open
Submitted by:
Olivier MATROT (omatrot)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.11
Category:
None
Group:
None
Resolution:
None
Summary:
NOTICE breaks CommandTimeout Support

Detailed description
See : http://pgfoundry.org/forum/forum.php?thread_id=15239&forum_id=519



By: Josh Cooley
RE: NOTICE breaks CommandTimeout Support [ reply ]
2012-09-17 23:24



As you might guess, we wait for the first response from the server when waiting for the command to timeout. Once we get something back from the server, we consider the timeout satisfied. It needs to be fixed, so please file a bug report. We'll have to add timeout checks in more places enhancing the state machine. That will take a bit of care, so a fix might not be available right away.





By: Olivier MATROT
NOTICE breaks CommandTimeout Support [ reply ]
2012-09-14 11:18



When issuing a SELECT query using NpgsqlDataAdapter, the CommandTimeout associated with the SelectCommand is not used, if the server raises a notice during this query. The query waits for the server to respond indefinitely.

Steps to reproduce the problem :
1) Use a function like this one :

CREATE OR REPLACE FUNCTION public.longfunction ()
RETURNS VOID AS
$BODY$
DECLARE
BEGIN
RAISE NOTICE 'Timeout !';
PERFORM pg_sleep(30);
end;$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION public.longfunction ()
OWNER TO postgres;

2) Call this function and experience the problem :

String cnstr = "DATABASE=" + _DatabaseName + ";SERVER=" + _Server + ";PORT=" + _Port +
";UID="+ _User + ";PWD=" + _Password + ";SyncNotification=True;Pooling=False;CommandTimeout=20";
NpgsqlConnection db_Connection = new NpgsqlConnection(cnstr);
NpgsqlCommand cmdNQ=new NpgsqlCommand(@"SELECT * FROM public.longfunction()", db_Connection);
System.Data.DataSet ds = new System.Data.DataSet();
NpgsqlDataAdapter da=new NpgsqlDataAdapter(cmdNQ);
try
{
da.Fill(ds);
}
catch (NpgsqlException e)
{
// Never goes here :-(
}

Of course the immediate solution is to remove the notice from the function, but this is impossible in production with thousands of function written like this one.

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge