Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randon provider Freeze [DNET334] #345

Closed
firebird-automations opened this issue Jul 24, 2010 · 18 comments
Closed

Randon provider Freeze [DNET334] #345

firebird-automations opened this issue Jul 24, 2010 · 18 comments

Comments

@firebird-automations
Copy link

Submitted by: Nicolas T (nftimmers)

Votes: 1

Hello in the data provider have a importante bug heres how to simulate him

In a http://asp.net page,

Open the connection and star a transaction on a method and then exit the method without close or commit the transaction

then when the page is reload recreate the connection and the transaction and try to run a simple sql,

the provider will freeze

tanks, was very dificult to find what is causing this problem

------------

Later seens that the problem not related to a transaction but with a heavy use of the systens like period about having 50 users or more making operations

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Well, it's a weird idea, but neither with:
FbConnection conn = new FbConnection(@"database=localhost:rrr.fdb;user=sysdba;password=masterkey;pooling=false");
conn.Open();
FbTransaction tx= conn.BeginTransaction();
or:
FbConnection conn = new FbConnection(@"database=localhost:rrr.fdb;user=sysdba;password=masterkey;pooling=false");
conn.Open();
FbTransaction tx= conn.BeginTransaction();

if (IsPostBack)
{
using (FbCommand cmd = conn.CreateCommand())
{
cmd.Transaction = tx;
cmd.CommandText = "select 1 from rdb$database";
cmd.ExecuteScalar();
}
}

I wasn't able to reproduce it.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello the problem hapens but if i stop the firebird they come back OK , debuging the problem first the code go to the

	public override DbValue\[\] Fetch\(\)
	\{
		if \(this\.state == StatementState\.Deallocated\)
		\{
			throw new InvalidOperationException\("Statement is not correctly created\."\);
		\}
		if \(this\.statementType \!= DbStatementType\.Select &&
			this\.statementType \!= DbStatementType\.SelectForUpdate\)
		\{
			return null;
		\}

		if \(\!this\.allRowsFetched && this\.rows\.Count == 0\)
		\{
			// Fetch next batch	of rows
			lock \(this\.database\.SyncObject\)
			\{
				try
				\{
					this\.database\.Write\(IscCodes\.op\_fetch\);
					this\.database\.Write\(this\.handle\);
					this\.database\.WriteBuffer\(this\.fields\.ToBlrArray\(\)\);
					this\.database\.Write\(0\);			// p\_sqldata\_message\_number						
					this\.database\.Write\(fetchSize\);	// p\_sqldata\_messages
					this\.database\.Flush\(\);

					if \(this\.database\.NextOperation\(\) == IscCodes\.op\_fetch\_response\)
					\{

AND STOP HERE - GOING INSIDE THE REAL LINE THAT FREEZE IS THIS

FILE = XdrStream

	public override int Read\(byte\[\] buffer, int offset, int count\)
	\{
		this\.CheckDisposed\(\);

		if \(this\.CanRead\)
		\{
			return this\.innerStream\.Read\(buffer, offset, count\);

HERE THE FIREBIRD CLIENT FREEZE AND DONT DO ANYTHING MORE

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

The problem dont apears to be relation with the transaction like the origin of the post

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello

the Guy on this link have the same problem that i iam having

http://www.mail-archive.com/firebird-net-provider@lists.sourceforge.net/msg04669.html

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Provide a reproducible test case.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Closed [ 6 ] => Reopened [ 4 ]

resolution: Cannot Reproduce [ 5 ] =>

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Component: http://ASP.NET Providers [ 10090 ] =>

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello Jiri the test case will be a realy problem because

* The problem ocures randon
* I cant reproduce on a test server only in my production server

This morning the problema ocurs and then all my 50 users that acess the system stoped to work so i have a small windows time to Debug the problem, in this morning i take about 30 minutes to debug and found that he problem is in the code paste above

so if by my developer machine i debug the database on my production server the problem occurs but im my local server not

How can i made a Test case ??

i dont know if the problem is related to a periods were high level of user access the system but i think so

So even if the problem ocurs on my test when i past the problem here he will no longer occurs because the server will be diferent and the problem will only ocurs later randomly

@firebird-automations
Copy link
Author

Modified by: Nicolas T (nftimmers)

description: Hello in the data provider have a importante bug heres how to simulate him

In a http://asp.net page,

Open the connection and star a transaction on a method and then exit the method without close or commit the transaction

then when the page is reload recreate the connection and the transaction and try to run a simple sql,

the provider will freeze

tanks, was very dificult to find what is causing this problem

=>

Hello in the data provider have a importante bug heres how to simulate him

In a http://asp.net page,

Open the connection and star a transaction on a method and then exit the method without close or commit the transaction

then when the page is reload recreate the connection and the transaction and try to run a simple sql,

the provider will freeze

tanks, was very dificult to find what is causing this problem

------------

Later seens that the problem not related to a transaction but with a heavy use of the systens like period about having 50 users or more making operations

summary: Transaction makes provider Freeze => Randon provider Freeze

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello in this link is a possible solution

http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.read(VS.71).aspx

specialy on this part that say

------------
Remarks
This method reads data into the buffer parameter and returns the number of bytes successfully read. If no data is available for reading, the NetworkStream.Read method will block until data is available. To avoid blocking, you can use the DataAvailable property to determine if data is queued in the incoming network buffer for reading. If DataAvailable returns true, the Read operation will complete immediately. The Read operation will read as much data as is available, up to the number of bytes specified by the size parameter. If the remote host shuts down the connection, and all available data has been received, the Read method will complete immediately and return zero bytes.

Note Check to see if the NetworkStream is readable by calling CanRead. If you attempt to read from a NetworkStream that is not readable, you will get an IOException.
Note If you receive a IOException check the InnerException property to determine if it was caused by a SocketException. If so, use ErrorCode to obtain the specific error code. Once you have obtained this code, you can refer to the Windows Socket Version 2 API error code documentation in MSDN for a detailed description of the error.
--------------------------

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

more actual link http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.read.aspx

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello Jiri can i change the Priority of this bug ?

Because the actual situation is realy complicated

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Another important information

the Data provider freeze in Specific tables like this morning the FREEZE was in the table "APAGAR", but the strange is that is for only some records but iif i get the SQL that iam trying to run on the DataProvider and run in the FlameRobin he runs ok

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello Jiri

Tomorow i gona do a big mobilization here in company trying to simulate the problem to we have a test case ok

Tanks

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

Hello bad news

i canot reproduce the problem on a test server the problem only ocurs on the Production server, i dont know if because the high number of users or what else can be

someone have an ideia to help ?

@firebird-automations
Copy link
Author

Commented by: Nicolas T (nftimmers)

OK This track can be closed i have a test program that i will create another issue

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Reopened [ 4 ] => Closed [ 6 ]

resolution: Incomplete [ 4 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants