TcpHandler in eventd times out too soon

Description

Many users take advantage of the ability to send events into eventd on port 5817. Something has changed between 1.8 and 1.10 that causes connections to that port to time out very quickly, on the order of seconds. This prevents code that used to work from working on 1.10.

Test:

On 1.8.16:

telnet localhost 5817
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

This connection will sit for a long time without closing.

On 1.10.0:
telnet localhost 5817
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

The connection is closed within a second. Here is the log:

==> eventd.log <==
2012-03-06 15:40:25,501 DEBUG [Event TCP Server[5817]] TcpServer: New connection accepted from 127.0.0.1:47237
2012-03-06 15:40:25,502 DEBUG [Event TCP Server[5817]] TcpServer: A new stream handler thread has been started
2012-03-06 15:40:25,502 DEBUG [Event TCP Server[5817]] TcpServer: Waiting for new connection
2012-03-06 15:40:25,502 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: Event Log Stream Handler Started for /127.0.0.1
2012-03-06 15:40:25,502 DEBUG [TCPRecord Chunker[127.0.0.1:47237]] TcpRecordHandler: Thread started, remote is 127.0.0.1
2012-03-06 15:40:26,002 DEBUG [TCPRecord Chunker[127.0.0.1:47237]] TcpRecordHandler: Thread Interrupted
2012-03-06 15:40:26,003 DEBUG [TCPRecord Chunker[127.0.0.1:47237]] TcpRecordHandler: Thread Terminated
2012-03-06 15:40:26,502 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: stopping record handler
2012-03-06 15:40:26,502 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpRecordHandler: Interrupting thread TCPRecord Chunker[127.0.0.1:47237]
2012-03-06 15:40:26,502 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpRecordHandler: Joining Thread TCPRecord Chunker[127.0.0.1:47237]
2012-03-06 15:40:26,503 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpRecordHandler: Thread TCPRecord Chunker[127.0.0.1:47237] Joined
2012-03-06 15:40:26,503 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: record handler stopped
2012-03-06 15:40:26,503 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: closing connnection
2012-03-06 15:40:26,504 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: connnection closed
2012-03-06 15:40:26,504 DEBUG [Event TCP Receiver[5817][127.0.0.1:47237]] TcpStreamHandler: Thread exiting

Environment

CentOS 6

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Benjamin Reed March 9, 2012 at 10:22 AM

fixed in 1.10 and master

Benjamin Reed March 8, 2012 at 8:47 AM

Nope... probably back when I was adding those thinking it was the appropriate thing to do, before I realized it could have unintended consequences.

Feel free to revert, or I can if you want.

Matt Brozowski March 8, 2012 at 1:15 AM

Hey Ben,

Can you tell me why we added calls to Thread.interrupt in this commit.

8cc3981aaaee32884d9587519d49afff2d703ba0

Matt

Tarus Balog March 6, 2012 at 3:47 PM

I'm going to make this block 1.10.1

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created March 6, 2012 at 3:45 PM
Updated January 27, 2017 at 4:19 PM
Resolved March 9, 2012 at 10:22 AM