Skip to content

Commit 6f5e19f

Browse files
authored
Merge pull request #1275 from docker/1.10.5-release
1.10.5 release
2 parents 20be7d5 + aba3317 commit 6f5e19f

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

docker/transport/npipesocket.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
import win32file
66
import win32pipe
77

8+
cERROR_PIPE_BUSY = 0xe7
89
cSECURITY_SQOS_PRESENT = 0x100000
910
cSECURITY_ANONYMOUS = 0
10-
cPIPE_READMODE_MESSAGE = 2
11+
12+
RETRY_WAIT_TIMEOUT = 10000
1113

1214

1315
def check_closed(f):
@@ -45,15 +47,27 @@ def close(self):
4547
@check_closed
4648
def connect(self, address):
4749
win32pipe.WaitNamedPipe(address, self._timeout)
48-
handle = win32file.CreateFile(
49-
address,
50-
win32file.GENERIC_READ | win32file.GENERIC_WRITE,
51-
0,
52-
None,
53-
win32file.OPEN_EXISTING,
54-
cSECURITY_ANONYMOUS | cSECURITY_SQOS_PRESENT,
55-
0
56-
)
50+
try:
51+
handle = win32file.CreateFile(
52+
address,
53+
win32file.GENERIC_READ | win32file.GENERIC_WRITE,
54+
0,
55+
None,
56+
win32file.OPEN_EXISTING,
57+
cSECURITY_ANONYMOUS | cSECURITY_SQOS_PRESENT,
58+
0
59+
)
60+
except win32pipe.error as e:
61+
# See Remarks:
62+
# https://msdn.microsoft.com/en-us/library/aa365800.aspx
63+
if e.winerror == cERROR_PIPE_BUSY:
64+
# Another program or thread has grabbed our pipe instance
65+
# before we got to it. Wait for availability and attempt to
66+
# connect again.
67+
win32pipe.WaitNamedPipe(address, RETRY_WAIT_TIMEOUT)
68+
return self.connect(address)
69+
raise e
70+
5771
self.flags = win32pipe.GetNamedPipeInfo(handle)[0]
5872

5973
self._handle = handle

docker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "1.10.4"
1+
version = "1.10.5"
22
version_info = tuple([int(d) for d in version.split("-")[0].split(".")])

docs/change_log.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Change Log
22
==========
33

4+
1.10.5
5+
------
6+
7+
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/24?closed=1)
8+
9+
### Bugfixes
10+
11+
* Fixed an issue where concurrent attempts to access to a named pipe by the
12+
client would sometimes cause recoverable exceptions to be raised.
13+
14+
415
1.10.4
516
------
617

0 commit comments

Comments
 (0)