You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Nathan Reese (JIRA)" <ji...@apache.org> on 2010/09/02 21:33:53 UTC
[jira] Created: (ABDERA-264) AbderaClient does not release
HttpClient connection after method execution
AbderaClient does not release HttpClient connection after method execution
--------------------------------------------------------------------------
Key: ABDERA-264
URL: https://issues.apache.org/jira/browse/ABDERA-264
Project: Abdera
Issue Type: Bug
Affects Versions: 1.1
Reporter: Nathan Reese
AbderaClient does not release HttpClient connection after method execution
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ABDERA-264) AbderaClient does not release
HttpClient connection after method execution
Posted by "Nathan Reese (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924437#action_12924437 ]
Nathan Reese commented on ABDERA-264:
-------------------------------------
Thanks for catching this.
The version of AbderaClient that I submitted for this JIRA releases the HttpMethod immediately after execution.
The failing unit test attempts to verify the content of a CommonsResponse after executing a method. The CommonsResponse class retains the HttpMethod as a private member. Getting the response content entails getting an InputStream from the HttpMethod instance member. Since my version of AbderaClient released the HttpMethod's resources after execution, this unit test exposed the problems that you discovered.
The CommonsResponse class exposes a method to release the HttpMethod member. I did not see this at the time I was working with AbderaClient. I only saw the behavior of my client hanging after a few POST attempts.
Since there is an easy way to release the HttpMethod resources, maybe this JIRA should just be closed. However, I found this very confusing as someone new to the project. Maybe AbderaClient needs better documentation or usage examples to clearly explain that it is the callers responsibility to release the HttpMethod resources. Or, why does the caller even need to be concerned with releasing a private member's resources? Does the CommonsResponse class really need to retain the HttpMethod? This just makes things more complicated for the end user then they need to be. What do you think?
> AbderaClient does not release HttpClient connection after method execution
> --------------------------------------------------------------------------
>
> Key: ABDERA-264
> URL: https://issues.apache.org/jira/browse/ABDERA-264
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Nathan Reese
> Attachments: AbderaClient.java
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> AbderaClient does not release HttpClient connection after method execution
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ABDERA-264) AbderaClient does not release
HttpClient connection after method execution
Posted by "Nathan Reese (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Reese updated ABDERA-264:
--------------------------------
Attachment: AbderaClient.java
Attached file contains fix in the execute method that releases the connection after execution.
> AbderaClient does not release HttpClient connection after method execution
> --------------------------------------------------------------------------
>
> Key: ABDERA-264
> URL: https://issues.apache.org/jira/browse/ABDERA-264
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Nathan Reese
> Attachments: AbderaClient.java
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> AbderaClient does not release HttpClient connection after method execution
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ABDERA-264) AbderaClient does not release
HttpClient connection after method execution
Posted by "ant elder (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924292#action_12924292 ]
ant elder commented on ABDERA-264:
----------------------------------
I've tried applying this fix but it causes three unit tests in the abdera-client module to fail. Have you run these, could you take a look? The errors are:
abdera-client
org.apache.abdera.test.client.cache.CacheTest
testResponseNoStore(org.apache.abdera.test.client.cache.CacheTest)
java.lang.NullPointerException
at java.io.FilterInputStream.close(FilterInputStream.java:155)
at org.apache.abdera.test.client.cache.CacheTest.getResponse(CacheTest.java:460)
at org.apache.abdera.test.client.cache.CacheTest._responseNoCache(CacheTest.java:432)
at org.apache.abdera.test.client.cache.CacheTest.testResponseNoStore(CacheTest.java:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
testResponseNoCache(org.apache.abdera.test.client.cache.CacheTest)
java.lang.NullPointerException
at java.io.FilterInputStream.close(FilterInputStream.java:155)
at org.apache.abdera.test.client.cache.CacheTest.getResponse(CacheTest.java:460)
at org.apache.abdera.test.client.cache.CacheTest._responseNoCache(CacheTest.java:432)
at org.apache.abdera.test.client.cache.CacheTest.testResponseNoCache(CacheTest.java:229)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
testResponseMaxAge0(org.apache.abdera.test.client.cache.CacheTest)
java.lang.NullPointerException
at java.io.FilterInputStream.close(FilterInputStream.java:155)
at org.apache.abdera.test.client.cache.CacheTest.getResponse(CacheTest.java:460)
at org.apache.abdera.test.client.cache.CacheTest._responseNoCache(CacheTest.java:432)
at org.apache.abdera.test.client.cache.CacheTest.testResponseMaxAge0(CacheTest.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> AbderaClient does not release HttpClient connection after method execution
> --------------------------------------------------------------------------
>
> Key: ABDERA-264
> URL: https://issues.apache.org/jira/browse/ABDERA-264
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Nathan Reese
> Attachments: AbderaClient.java
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> AbderaClient does not release HttpClient connection after method execution
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.