[ 
https://issues.apache.org/jira/browse/KAFKA-1282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nicu marasoiu updated KAFKA-1282:
---------------------------------
    Comment: was deleted

(was: Hi [~junrao], [~nehanarkhede],

I added a straight test. 

I saw on my mac that an epoll can take 300ms on low/no traffic. Consequently I 
have put a wait slightly longer but clearly there is a coin flip. I see the 
following possible solutions to deterministic testing here:
- mock time: inject a Time instance in constructor, SystemTime in prod code, 
and a mocked/stubbed on from test (I am on this currently)
- mock selector => select time will be deterministic and close to zero
- try more than once, waiting 50% more time each time (until n attempts and/or 
max wait time)
- simulate time (e.g. clock change) and "wait" more

I can also try a test with multiple connections, if you think it is worth it. 

I have 2 versions of the same patch: it differs in the way the new test is 
inserted: in the same or new test class (which allows independent 
parametrizations of the server).
I extracted some methods out in order to parametrize differently the server but 
still reuse. 
However I also attach a version without extracting.)

> Disconnect idle socket connection in Selector
> ---------------------------------------------
>
>                 Key: KAFKA-1282
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1282
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.8.2.0
>            Reporter: Jun Rao
>            Assignee: nicu marasoiu
>              Labels: newbie++
>             Fix For: 0.8.3
>
>         Attachments: 1282_access-order.patch, 1282_brush.patch, 
> 1282_brushed_up.patch, 
> KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch
>
>
> To reduce # socket connections, it would be useful for the new producer to 
> close socket connections that are idle. We can introduce a new producer 
> config for the idle time.



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

Reply via email to