pyats icon indicating copy to clipboard operation
pyats copied to clipboard

Use SO_REUSEADDR on liveview/log view server socket

Open vista- opened this issue 5 years ago • 2 comments

Hey folks,

I've been trying to cobble together a small service that runs a given network job, runs a liveview server during the run and keeps the log viewer open for later usage. I'm not using Xpresso as I'd like to keep this setup as lightweight as possible; the output of the log viewer works perfectly for my use-case.

The problem is the following: if a user keeps viewing this log, their browser keeps polling the server for updates, which creates short-lived TCP connections that go into a TIME_WAIT state. Should the user want to run a different test (or rerun the current test), they'd have to restart the pyats process (which my script does), but due to the existing TCP connections stuck in a TIME_WAIT state, the process is unable to bind to the socket due to this missing socket option.

This problem would be resolved if this socket option were added to the web server sockets spawned by the liveviewer/log viewer.

vista- avatar Sep 23 '20 17:09 vista-

I've found the --reuse-port option for the pyats logs view subcommand, but I don't think that works for the pyats job run subcommand.

vista- avatar Sep 23 '20 17:09 vista-

Hi @vista- We are looking into your inquiry, and discussing about this improvement. I will get back to you soon on this.

KamyarZiabari avatar Oct 01 '20 15:10 KamyarZiabari