You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The python API wrapper function for client connect has a SIGALRM handler which goes off after 3s.
{{def handler(signum, frame):
print('Signal handler called with signal', signum)
raise IOError("Couldn't connect to VPP!")</p>
def connect(name, chroot_prefix = None):
Set the signal handler
signal.signal(signal.SIGALRM, handler)</li>
signal.alarm(3) # 3 second}}
There are two issues with this:
- Even though the alarm fires after 3s have elapsed, the connect call itself continues to wait for the normal TCP connect timeout period (around 75s). The signal handler code executes after the connect call returns. This is due to the way signal handling happens in python.
- In a scenario where user restarts/starts VPP and subsequently tries a vpp_papi.connect(), the connect may or may not succeed depending on how long VPP takes to start. Assuming VPP takes more than 3s but but less than the TCP connect timeout interval, then the connect() would have succeeded but since the signal handler executes (3s have elapsed), it terminates the process.
I think the signal handler does not server the purpose it was intended for - to abort the connect() if it takes longer than 3s.
Description
The python API wrapper function for client connect has a SIGALRM handler which goes off after 3s.
{{def handler(signum, frame):
def connect(name, chroot_prefix = None):
There are two issues with this:
- Even though the alarm fires after 3s have elapsed, the connect call itself continues to wait for the normal TCP connect timeout period (around 75s). The signal handler code executes after the connect call returns. This is due to the way signal handling happens in python.
- In a scenario where user restarts/starts VPP and subsequently tries a vpp_papi.connect(), the connect may or may not succeed depending on how long VPP takes to start. Assuming VPP takes more than 3s but but less than the TCP connect timeout interval, then the connect() would have succeeded but since the signal handler executes (3s have elapsed), it terminates the process.
I think the signal handler does not server the purpose it was intended for - to abort the connect() if it takes longer than 3s.
Assignee
Unassigned
Reporter
Onong Tayeng
Comments
No comments.
Original issue: https://jira.fd.io/browse/VPP-463
The text was updated successfully, but these errors were encountered: