[ 
https://issues.apache.org/jira/browse/KAFKA-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14337608#comment-14337608
 ] 

Gwen Shapira commented on KAFKA-1400:
-------------------------------------

Kinda strange, the TCPDUMP looks the same whether I get an exception or not:

{code}
16:52:17.249207 IP localhost.55538 > localhost.9095: Flags [S], seq 3746193634, 
win 65535, options [mss 16344,nop,wscale 5,nop,nop,TS val 1314712608 ecr 
0,sackOK,eol], length 0
16:52:17.249257 IP localhost.9095 > localhost.55538: Flags [S.], seq 999508519, 
ack 3746193635, win 65535, options [mss 16344,nop,wscale 3,nop,nop,TS val 
1314712608 ecr 1314712608,sackOK,eol], length 0
16:52:17.249264 IP localhost.55538 > localhost.9095: Flags [.], ack 1, win 
12759, options [nop,nop,TS val 1314712608 ecr 1314712608], length 0
16:52:17.249270 IP localhost.9095 > localhost.55538: Flags [.], ack 1, win 
38788, options [nop,nop,TS val 1314712608 ecr 1314712608], length 0
16:52:22.436127 IP localhost.55538 > localhost.9095: Flags [P.], seq 1:2, ack 
1, win 12759, options [nop,nop,TS val 1314717768 ecr 1314712608], length 1
16:52:22.436162 IP localhost.9095 > localhost.55538: Flags [.], ack 2, win 
38788, options [nop,nop,TS val 1314717768 ecr 1314717768], length 0
16:52:22.436169 IP localhost.55538 > localhost.9095: Flags [P.], seq 2:7, ack 
1, win 12759, options [nop,nop,TS val 1314717768 ecr 1314717768], length 5
16:52:22.436173 IP localhost.9095 > localhost.55538: Flags [.], ack 7, win 
38787, options [nop,nop,TS val 1314717768 ecr 1314717768], length 0
16:52:22.436177 IP localhost.55538 > localhost.9095: Flags [P.], seq 7:47, ack 
1, win 12759, options [nop,nop,TS val 1314717768 ecr 1314717768], length 40
16:52:22.436180 IP localhost.9095 > localhost.55538: Flags [.], ack 47, win 
38782, options [nop,nop,TS val 1314717768 ecr 1314717768], length 0
16:52:22.484320 IP localhost.9095 > localhost.55538: Flags [P.], seq 1:23, ack 
47, win 38782, options [nop,nop,TS val 1314717808 ecr 1314717768], length 22
16:52:22.484353 IP localhost.55538 > localhost.9095: Flags [.], ack 23, win 
12758, options [nop,nop,TS val 1314717808 ecr 1314717808], length 0
16:52:22.552365 IP localhost.9095 > localhost.55538: Flags [F.], seq 23, ack 
47, win 38782, options [nop,nop,TS val 1314717872 ecr 1314717808], length 0
16:52:22.552372 IP localhost.55538 > localhost.9095: Flags [.], ack 24, win 
12758, options [nop,nop,TS val 1314717872 ecr 1314717872], length 0
16:52:22.552376 IP localhost.9095 > localhost.55538: Flags [.], ack 47, win 
38782, options [nop,nop,TS val 1314717872 ecr 1314717872], length 0
16:52:28.632196 IP localhost.55538 > localhost.9095: Flags [P.], seq 47:48, ack 
24, win 12758, options [nop,nop,TS val 1314723916 ecr 1314717872], length 1
16:52:28.632235 IP localhost.9095 > localhost.55538: Flags [R], seq 999508543, 
win 0, length 0
{code}

I get a FIN, I ack it. I send one extra packet and I get a RST. Pretty much as 
expected.

Whether I get an exception or not, OTOH is completely random. I'm guessing this 
is because the .write() and .flush() methods are async.

As documented for output stream: The <code>flush</code> method of 
<code>OutputStream</code> does nothing.

I *think* that if I force a sleep after some bytes were written, I'll always 
get an exception. I'm not too happy with this approach.

Any thoughts?



> transient unit test failure in SocketServerTest
> -----------------------------------------------
>
>                 Key: KAFKA-1400
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1400
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.8.2.0
>            Reporter: Jun Rao
>            Assignee: Neha Narkhede
>             Fix For: 0.8.2.0
>
>         Attachments: KAFKA-1400.patch
>
>
> Saw the following transient failure.
> kafka.network.SocketServerTest > testSocketsCloseOnShutdown FAILED 
> java.lang.AssertionError: Expected exception: java.net.SocketException 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to