Forum: Critical bugs fixed. RC3 is on the way...

Posted by: Francisco Figueiredo jr.
Date: 2006-08-11 11:59
Summary:Critical bugs fixed. RC3 is on the way...
Project:Npgsql .Net Data Provider for Postgresql

Hi all,

These past 10 days, Josh Cooley fixed and helped to fix a lot of critical bugs on Npgsql! Here are they:

Josh Cooley fixed a bug when dealing with concurrent connection establishment using Npgsql RC2. When I implemented ConnectionTimeout support for connection establishment, I was incorrectly using an instance variable with a singleton object :(
This was leading to some nasty problems like

Here is the relevant stack trace:

Operation not allowed on non-connected sockets.
at Npgsql.NpgsqlClosedState.Open(NpgsqlConnector context)
at Npgsql.NpgsqlConnector.Open()
at Npgsql.NpgsqlConnectorPool.GetNonPooledConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection Connection)
at Npgsql.NpgsqlConnection.Open()

Another problem, this time with async notification support, was that Npgsql wasn't handling correctly the notification message sent from server when async notification was off. This was leading to nasty exceptions from Npgsql about "this stream doesn't not support seek operation". More information about this bug can be found here Josh Cooley had a critical role here as his observations about some details on code while struggling to fix this bug lead us to find the culpirit. Thank you, Josh! This is the root stack trace:

System.NotSupportedException: This stream does not
support seek operations.
at System.Net.Sockets.NetworkStream.Seek(Int64 offset, SeekOrigin origin)
at System.IO.BufferedStream.FlushRead()
at System.IO.BufferedStream.WriteByte(Byte value)
at Npgsql.NpgsqlQuery.WriteToStream(Stream outputStream, Encoding encoding)
at Npgsql.NpgsqlReadyState.Query(NpgsqlConnector context, NpgsqlCommand command)
at Npgsql.NpgsqlConnector.Query(NpgsqlCommand queryCommand)
at Npgsql.NpgsqlCommand.ExecuteCommand()
at Npgsql.NpgsqlCommand.ExecuteNonQuery()

One thing worth noting here is that if you look closer, this exception is caused because BufferedStream, when flusing the stream, calls Seek method! It seems FlushRead() doesn't check if the stream passed can seek or not. This error only happens on, 1.1 and 2.0.
Mono correctly checks if stream can seek when flushing the stream and doesn't throw the exception.

So, if you are being affected by some of these bugs ( or all of them :) ) and need an urgent fix, please grab a copy of cvs and give it a try. Otherwise, RC3 release is on the way with those fixes.

Sorry for any problem this may have caused to you.

Sponsors Ads

Latest News

Npgsql code repository changed to git

Francisco Figueiredo jr. - 2013-06-28 22:35 -

Npgsql 2.0.12 beta2 released!

Francisco Figueiredo jr. - 2011-09-29 02:30 -

Npgsql receives donation of an MSDN subscription!!

Francisco Figueiredo jr. - 2010-08-23 22:13 -

Entity Framework Sample posted

Francisco Figueiredo jr. - 2009-11-12 20:48 -

Npgsql 2.0.6 released!

Francisco Figueiredo jr. - 2009-07-21 14:35 -
Monitor Forum | Start New Thread Start New Thread
Powered By FusionForge