Browse code

Update hcsshim to v0.6.5

Signed-off-by: Darren Stahl <darst@microsoft.com>

Darren Stahl authored on 2017/09/08 10:23:57
Showing 2 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 # the following lines are in sorted order, FYI
2 2
 github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e
3
-github.com/Microsoft/hcsshim v0.6.4
3
+github.com/Microsoft/hcsshim v0.6.5
4 4
 github.com/Microsoft/go-winio v0.4.5
5 5
 github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
6 6
 github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
... ...
@@ -201,12 +201,18 @@ func createContainerWithJSON(id string, c *ContainerConfig, additionalJSON strin
201 201
 
202 202
 	if createError == nil || IsPending(createError) {
203 203
 		if err := container.registerCallback(); err != nil {
204
+			// Terminate the container if it still exists. We're okay to ignore a failure here.
205
+			container.Terminate()
204 206
 			return nil, makeContainerError(container, operation, "", err)
205 207
 		}
206 208
 	}
207 209
 
208 210
 	err = processAsyncHcsResult(createError, resultp, container.callbackNumber, hcsNotificationSystemCreateCompleted, &defaultTimeout)
209 211
 	if err != nil {
212
+		if err == ErrTimeout {
213
+			// Terminate the container if it still exists. We're okay to ignore a failure here.
214
+			container.Terminate()
215
+		}
210 216
 		return nil, makeContainerError(container, operation, configuration, err)
211 217
 	}
212 218