You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/12/27 19:12:44 UTC

[jira] Commented: (SYNAPSE-491) Sporadic test failures in NIO HTTP tests

    [ https://issues.apache.org/jira/browse/SYNAPSE-491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659360#action_12659360 ] 

Andreas Veithen commented on SYNAPSE-491:
-----------------------------------------

The messagesSent metric is updated immediately after the message content has been streamed to the SharedOutputBuffer (see HttpCoreNIOSender#sendAsyncRequest), while the bytesSent metric is updated only after the data has been written to the HTTP connection. This explains why the assertion on messagesSent succeeds while the assertion on bytesSent fails.

The attached logs indicate that it sometimes happens that the entire request is processed by the test endpoint between the write operation and the metrics update. This is quite surprising since the request has to flow through the TCP monitor set up by HttpChannel and through Jetty's HTTP dispatcher, while on the client side the metrics are updated immediately after the write operation (see ClientHandler#outputReady). However this explanation is compatible with the observation that the test failure mainly occurs if the system running the test is under load. Also there is no indication that the HttpCoreNIOSender thread blocks between the write operation and the metrics update. The conclusion is therefore that there is no problem with the HTTP transport but that the transport testkit needs to be modified to give the transport sender more time to update the metrics.

> Sporadic test failures in NIO HTTP tests
> ----------------------------------------
>
>                 Key: SYNAPSE-491
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-491
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>            Reporter: Andreas Veithen
>            Priority: Minor
>         Attachments: 01-debug.log
>
>
> From time to time, one or more of the tests in HttpCoreNIOListenerTest fail with the following assertion failure:
> junit.framework.AssertionFailedError: No increase in bytes sent
>     at junit.framework.Assert.fail(Assert.java:47)
>     at junit.framework.Assert.assertTrue(Assert.java:20)
>     at org.apache.axis2.transport.testkit.axis2.client.AxisTestClient.afterReceive(AxisTestClient.java:115)
>     at org.apache.axis2.transport.testkit.tests.MessageTestCase.runTest(MessageTestCase.java:64)
>     ...
> The code containing the assertion looks as follows:
>         if (sender instanceof ManagementSupport) {
>             ManagementSupport sender = (ManagementSupport)this.sender;
>             Assert.assertEquals(messagesSent+1, sender.getMessagesSent());
>             Assert.assertTrue("No increase in bytes sent", sender.getBytesSent() > bytesSent);
>         }
> This would mean that under some circumstances the transport sender doesn't correctly update the metrics for bytes sent (while the number of messages sent is increased as expected).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org