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

Connections left open in 4.1.10.0-RC1 #222

Closed
JWollnik opened this issue Jan 19, 2017 · 12 comments
Closed

Connections left open in 4.1.10.0-RC1 #222

JWollnik opened this issue Jan 19, 2017 · 12 comments

Comments

@JWollnik
Copy link

JWollnik commented Jan 19, 2017

We are currently testing 4.1.10.0-RC1 and observed error messages about connections left open:

13:54:27.270 [Finalizer] ERROR org.irods.jargon.core.connection.AbstractConnection - **************************************************************************************
13:54:27.270 [Finalizer] ERROR org.irods.jargon.core.connection.AbstractConnection - ********  WARNING: POTENTIAL CONNECTION LEAK  ******************
13:54:27.270 [Finalizer] ERROR org.irods.jargon.core.connection.AbstractConnection - ********  finalizer has run and found a connection left opened, please check your code to ensure that all connections are closed
13:54:27.270 [Finalizer] ERROR org.irods.jargon.core.connection.AbstractConnection - ********  connection is:irods://username.homezone@dev:1247/homezone/home/johannes/main/1484830466782, will attempt to disconnect
13:54:27.270 [Finalizer] ERROR org.irods.jargon.core.connection.AbstractConnection - **************************************************************************************

Here's the code snippet used for testing:

	public static void main(String[] args) throws JargonException {
		IRODSFileSystem fs = null;
		try {
			fs = IRODSFileSystem.instance();
			IRODSSession session = fs.getIrodsSession();
			session.setX509TrustManager(SSL.getTrustManager());
			IRODSAccount account = createIrodsAccount(args);
			account.setAuthenticationScheme(AuthScheme.PAM);
			IRODSAccessObjectFactory f = fs.getIRODSAccessObjectFactory();
			f.authenticateIRODSAccount(account);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (fs != null) {
				fs.close();
			}
			System.gc();
			System.runFinalization();
		}
	}

The error messages also occurr with standard authorization. In 4.0.2.6-RELEASE we have not seen such error messages.

@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017 via email

@marc-flesch
Copy link

Dear Michael,

any timelines when RC2 will be made available to the public?

Just asking,
Marc

michael-conway pushed a commit that referenced this issue Jan 19, 2017
@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017 via email

@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017

Alternately, the 4.1.10.0-SNAPSHOT is also available on maven and is up-to-date. FWIW here is the test I added...I observe no finalizer messages, so I think other related issues that we cleaned up this week could have been at play.

/**
	 * refers to Connections left open in 4.1.10.0-RC1 #222
	 */
	@Test
	public void testConnAndFinalizationViaIrodsFileSystemBug222()
			throws Exception {

		int times = 50;

		IRODSFileSystem fs = null;

		for (int i = 0; i < times; i++) {

			try {
				fs = IRODSFileSystem.instance();
				IRODSSession session = fs.getIrodsSession();
				IRODSAccount account = testingPropertiesHelper
						.buildPamIrodsAccountFromTestProperties(testingProperties);
				account.setAuthenticationScheme(AuthScheme.PAM);
				IRODSAccessObjectFactory f = fs.getIRODSAccessObjectFactory();
				f.authenticateIRODSAccount(account);
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				if (fs != null) {
					fs.close();
				}
				System.gc();
				System.runFinalization();
			}

			Assert.assertTrue("should be no conns in map", fs.getIrodsSession()
					.getIRODSCommandsMap() == null);
		}

	}

@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017

would it be ok to test via the 4.1.10.0-SNAPSHOT?

Then if you see that cleaned up, it would be a point to pull the trigger on the rc2. There is another test out in the field on PAM this morning, and clearing these two issues would be a nice point to cut the RC2.

If you use Maven, the snapshots are available using these repos...


<repositories>
		<repository>
			<id>dice.repository snaps</id>
			<name>dice.repository.snapshots</name>
			<url>https://raw.github.com/DICE-UNC/DICE-Maven/master/snapshots</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
				<checksumPolicy>warn</checksumPolicy>
			</snapshots>
		</repository>
		<repository>
			<id>dice.repository</id>
			<name>dice.repository</name>
			<url>https://raw.github.com/DICE-UNC/DICE-Maven/master/releases</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
				<checksumPolicy>warn</checksumPolicy>
			</snapshots>
		</repository>
		
	</repositories>

and these coordinates



<dependency>
				<groupId>org.irods.jargon</groupId>
				<artifactId>jargon-core</artifactId>
				<version>${jargon.version}</version>
			</dependency>

with the version at 4.1.10.0-SNAPSHOT

Would that be OK as the plan?

@JWollnik
Copy link
Author

Hi Michael,

thanks for your quick response. I tested against 4.1.10.0-SNAPSHOT and observed with the snippet from above no issues anymore!

However, I was playing around with new negotiation option and had the same connection leakage warning when using the NO_NEGOTIATION option with 4.1.10.0-SNAPSHOT.

	public static void main(String[] args) throws JargonException {
		IRODSFileSystem fs = null;
		try {
			fs = IRODSFileSystem.instance();
			IRODSSession session = fs.getIrodsSession();
			SettableJargonProperties props = new SettableJargonProperties(session.getJargonProperties());
			props.setNegotiationPolicy(ClientServerNegotiationPolicy.SslNegotiationPolicy.NO_NEGOTIATION);
			session.setJargonProperties(props);
			session.setX509TrustManager(SSL.getTrustManager());
			IRODSAccount account = createIrodsAccount(args);
			account.setAuthenticationScheme(AuthScheme.PAM);
			IRODSAccessObjectFactory f = fs.getIRODSAccessObjectFactory();
			f.authenticateIRODSAccount(account);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (fs != null) {
				fs.close();
			}
			System.runFinalization();
			System.gc();
		}
	}

@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017 via email

@marc-flesch
Copy link

marc-flesch commented Jan 19, 2017

Thank you for looking into this Michael!

For us it would be of importance to have an official tag (e.g. RC2) to be able to embed your code in our testing and validation suite. Whenever you feel comfortable with your changes, can you please pull the trigger on RC2? That would be of great help for us. Thx Marc.

@michael-conway
Copy link
Collaborator

michael-conway commented Jan 19, 2017 via email

@michael-conway
Copy link
Collaborator

I added a test and can see those messages, will clean that up. NB that the message indicates the finalizer is properly closing them in the background.

michael-conway pushed a commit that referenced this issue Jan 23, 2017
@marc-flesch
Copy link

marc-flesch commented Jan 23, 2017

Thank you Michael,

we will include RC2 in our tomorrows nightly build and check.

Best,
Marc.

@michael-conway
Copy link
Collaborator

thanks, I'm testing it now in REST, Cloud Browser, and WebDav, so far so good, and I expect that full release this week barring any developments

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

No branches or pull requests

3 participants