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

Jun Rao commented on KAFKA-1282:
--------------------------------

Thanks for the patch. Looks good to me overall. Some minor comments below.

1. Could we make connectionsLruTimeout a broker side configuration?

2. Do we need to insert the key to lruConnections in write()? It seems to me 
doing that in read() (for incoming requests) is enough.

3. The patch doesn't seem to apply for me. Could you rebase?

git  apply -p0 
~/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch 
/Users/jrao/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch:13:
 trailing whitespace.
import java.util
/Users/jrao/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch:21:
 trailing whitespace.
import java.util.Map.Entry
/Users/jrao/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch:30:
 trailing whitespace.
  private val connectionsLruTimeout: Long = TimeUnit.MINUTES.toNanos(10)
/Users/jrao/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch:31:
 trailing whitespace.
  private var currentTime: Long = SystemTime.nanoseconds
/Users/jrao/Downloads/KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.patch:32:
 trailing whitespace.
  private val lruConnections = new util.LinkedHashMap[SelectionKey, Long](100, 
.75F, true) {
error: patch failed: core/src/main/scala/kafka/network/SocketServer.scala:16
error: core/src/main/scala/kafka/network/SocketServer.scala: patch does not 
apply


> 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
>            Reporter: Jun Rao
>            Assignee: Neha Narkhede
>              Labels: newbie++
>             Fix For: 0.9.0
>
>         Attachments: 
> KAFKA-1282_Disconnect_idle_socket_connection_in_Selector.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.2#6252)

Reply via email to