HTTP connections fail under Windows subsystem for Linux
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
keystoneauth |
Fix Released
|
Medium
|
Alex Oughton |
Bug Description
Hello,
HTTP connections are failing when running under Windows subsystem for Linux:
ERROR (ConnectFailure): Unable to establish connection to https:/
Through strace, I established that this was failing when TCP_KEEPCNT was being set to 4:
setsockopt(3, SOL_TCP, TCP_KEEPCNT, [4], 4) = -1 EINVAL (Invalid argument)
This is being caused by the TCPKeepAliveAdapter class in session.py which sets various parameters in order to disable Nagle's algorithm. The Windows Subsystem for Linux is not yet a complete implementation of Linux APIs, and overriding TCP_KEEPCNT doesn't appear to have been implemented yet. This is why the "Invalid argument" error is occurring.
The error can be avoided by simply checking if we're running under WSL, and skipping the TCP_KEEPCNT change if so.
Old check:
if hasattr(socket, 'TCP_KEEPCNT'):
New check:
if hasattr(socket, 'TCP_KEEPCNT') and not (os.path.
I'll be submitting a patch shortly.
Thanks,
Alex Oughton
Changed in keystoneauth: | |
assignee: | nobody → Alex Oughton (alex-oughton) |
Changed in keystoneauth: | |
assignee: | Alex Oughton (alex-oughton) → Steve Martinelli (stevemar) |
Changed in keystoneauth: | |
importance: | Undecided → Medium |
assignee: | Steve Martinelli (stevemar) → Alex Oughton (alex-oughton) |
Changed in keystoneauth: | |
assignee: | Alex Oughton (alex-oughton) → Samuel de Medeiros Queiroz (samueldmq) |
Changed in keystoneauth: | |
assignee: | Samuel de Medeiros Queiroz (samueldmq) → Alex Oughton (alex-oughton) |
Changed in keystoneauth: | |
assignee: | Alex Oughton (alex-oughton) → Steve Martinelli (stevemar) |
Changed in keystoneauth: | |
assignee: | Steve Martinelli (stevemar) → Alex Oughton (alex-oughton) |
Fix proposed to branch: master /review. openstack. org/357452
Review: https:/