News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
heavy data load hangs  
by Angel Todorov [atodorov at acm dot org]
posted on 2003/10/31

Hello,

i have successfully integrated the Mentalis Security lib into a database driver for PostgreSQL. Though, the application that uses the driver has to manage heavy load of data (example: creation of 10-20 thousand table rows, selection of 100 thousand rows for example, and so on). Sometimes it works, but sometimes it just hangs at a random place and no exception occurs, it just stays at that place forever. I am creating the tests using for loops.
for example to insert 10 000 rows, in the for loop output "ith write" where "i" is the number of the row inserted, so sometimes i get the test successful but sometimes it just hangs on a random "i". I am using a BufferedStream, which i create out of a SecureNetworkStream in my application. What is more interesting, is that i can clearly see that on certain numbers(that is, iterations), the application "flow" stops for a second, then resumes. These values of "i" in my for loop are fixed, i.e they don't change after i run the app. again and again. I guess it can be caused because of buffer sizes that i use for arrays, so if you think that by some reason this can be a prolem, can you give me specific values that may work, considering the current situation? (i.e database queries in general). Also, can there be some problem with the buffered streams? Maybe flushing them ?

My SecurityOptions is the following:

SecurityOptions options = new SecurityOptions(sp);
options.Entity = ConnectionEnd.Client;
options.CommonName=context.ServerName;
options.VerificationType = CredentialVerification.None; // don't verify certificate for now (debugging purposes)
//options.Verifier = new CertVerifyEventHandler(OnVerify);
options.Flags = SecurityFlags.Default;
options.AllowedAlgorithms = SslAlgorithms.SECURE_CIPHERS;

where sp is a SecurityProtocol.Tls1 value.

Thanks.

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/10/31

Can you provide me with a download link of the latest version of your project? [if I remember correctly, it's open source, right?]
I'll install PostgreSQL and see if I can reproduce the problem.

P.S. the short pauses can be explained by the GC

by Angel Todorov [atodorov at acm dot org]
posted on 2003/11/01

Hello,

Yep, it's open source. The location is:

http://gborg.postgresql.org/project/npgsql/projdisplay.php

Download link:

http://gborg.postgresql.org/project/npgsql/download/download.php?branch=devel

Pls be sure to update from the cvs, since only ver. 0.5 is available, and in the cvs it is newer, that is 0.6.
Btw, everything works fine without ssl support enabled , that's why i think it can be something from the lib.

I will email you the src of the already integrated ssl into the driver and with the libs.

Thanks a lot.

by Kevin Knoop
posted on 2003/11/03

The hangs are because of objects waiting on a ManualResetEvent that never gets signaled.
Modify the AsyncWaitHandle method in the class AsyncResult to the following:

public WaitHandle AsyncWaitHandle {
get {
if (m_WaitHandle == null)
m_WaitHandle = new ManualResetEvent(m_Completed);
if (m_Completed)
{
m_WaitHandle.Set();
}
return m_WaitHandle;
}
}

by Angel Todorov [atodorov at acm dot org]
posted on 2003/11/03

Thanks a lot, it fixed all problems. Never had a chance to look at this certain file :)

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/11/03

Great, thanks Kevin. I've uploaded a new version of the library that fixes this problem.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.