GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — socket timeout when docker exec lasts too long · Issue #3124 · docker/docker-py

socket timeout when docker exec lasts too long #3124

New issue
Copy link
New issue
Copy link
Closed
Closed
socket timeout when docker exec lasts too long#3124
Copy link
Assignees
milas
Labels
kind/buglevel/apiclient

Description

@loic-slamcore
loic-slamcore
opened on May 10, 2023
Issue body actions

Since docker-py 6.1.0, using container.exec_run raises a socket.timeout exception if the command executed exceeds the timeout set on sockets when initialising the client.
This can be reproduced with the following code:

import docker
client = docker.from_env(timeout=2)
cnt = client.containers.run("ubuntu:22.04", tty=True, detach=True)
cnt.exec_run("sleep 20")

This was introduced by this PR because the previous call to select.select would only listen for reads, whereas the call to poll.register also listens to POLLOUT events.

I guess there's a case for raising timeout errors but ignoring them was previously working just fine so in my eyes, no exception should be raised especially as the polling can wait until the socket really is available for read instead.

This has been reproduced with the following setup:

pip freeze | grep docker && python --version && docker version
docker==6.1.1
Python 3.11.3
Client: Docker Engine - Community
 Version:           23.0.6
 API version:       1.42
 Go version:        go1.19.9
 Git commit:        ef23cbc
 Built:             Fri May  5 21:18:22 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.9
  Git commit:       9dbdbd4
  Built:            Fri May  5 21:18:22 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Activity

  1. loic-slamcore commented on May 10, 2023

    @loic-slamcore
    loic-slamcore
    on May 10, 2023
    Author
    More actions

    I raised #3125 to resolve this issue.

  2. tonybart1337
    added a commit that references this issue on May 11, 2023

    resolve docker-py#3124 timeout

    This issue will close once commit 31a8d3c is merged into the 'master' branch.
    31a8d3c
  3. milas commented on May 12, 2023

    @milas
    milas
    on May 12, 2023
    Contributor
    More actions

    Fixed in 6.1.2. Thanks for raising the issue and fix!

  4. milas
    closed this as completedon May 12, 2023
  5. milas
    self-assigned this
    on May 12, 2023
  6. milas
    added
    kind/bug
    level/apiclient
    on May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @milas
    milas

Labels

kind/buglevel/apiclient

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.