Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP Socket not closing properly #34

Open
fkruta opened this issue Jun 4, 2015 · 0 comments
Open

TCP Socket not closing properly #34

fkruta opened this issue Jun 4, 2015 · 0 comments

Comments

@fkruta
Copy link

fkruta commented Jun 4, 2015

Hello,
I use krakow inside a rails app with ruby 2.2 MRE with krakow 0.4.2 and NSQ 0.3.5
I am creating and terminating a topic producer inside a controller to log some events that are reported by our mobile clients.

producer = Krakow::Producer.new(host: 'xx.xx.xx', port: 4150, topic: "#{@u_app_user.u_application_uid}")
producer.write(event_json)
producer.terminate

I noticed that after the connection is terminated in TCP connection remains in CLOSE_WAIT which btw can put the server down after the limit of max open socket/files is reached...For now I added a cron job to close the orphans connection in CLOSE_WAIT but this is not a solution to the problem...

# netstat -tonp 2>&1 | grep CLOSE
tcp       39      0 x.x.x.x:19689     x.x.x.x:4150        CLOSE_WAIT  -                off (0.00/0/0)
tcp       39      0 x.x.x.x:19689     x.x.x.x:4150        CLOSE_WAIT  -                off (0.00/0/0)
tcp       39      0 x.x.x.x:19689     x.x.x.x:4150        CLOSE_WAIT  -                off (0.00/0/0)
tcp       39      0 x.x.x.x:19689     x.x.x.x:4150        CLOSE_WAIT  -                off (0.00/0/0)
tcp       39      0 x.x.x.x:19689     x.x.x.x:4150        CLOSE_WAIT  -                off (0.00/0/0)
tcp       39      0x.x.x.x:19689     x.x.x.x:4150         CLOSE_WAIT  -                off (0.00/0/0)

Any ideas on finding a real fix ?

Thank you,
BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant