client.ping() now returns a DockerException rather than a ConnectionError if the Docker daemon cannot be reached
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
For the last several releases (since 4.3.1), DockerClient.ping() has raised a docker.errors.DockerException rather than the previously seen pass through of the requests.exceptions.ConnectionError.
A git bisect shows the change occurred in commit 727080b3cca846a28d5436bed861359c9742c7e1 which landed between v4.3.0 and v4.3.1. The log for this commit doesn't mention this API change as part of the intent, so I suspect it was accidental.
Would like to know if this should be fixed, or should be considered correct behavior and the handling of requests.exceptions.ConnectionError be removed from consuming code and replaced with docker.errors.DockerException.
Versions Affected: v4.3.1 to v5.0.0
Python Version Tested: 3.9.6
Docker Daemon Version: N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DockerClient.ping() and inspect commit 727080b3cca846a28d5436bed861359c9742c7e1, which introduced the changed exception behavior between v4.3.0 and v4.3.1. Compare the current behavior with the previously observed requests.exceptions.ConnectionError handling. Done means the intended public exception behavior is decided and the issue is resolved or documented consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100