diff options
author | Valentin Rothberg <vrothberg@suse.com> | 2018-06-05 10:11:03 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-05 17:03:58 +0000 |
commit | 7965bf54048044d63f967d2b4ce8efe1e1072f05 (patch) | |
tree | da8658704c91567ab2f0e7096a9c71870c3617c9 /vendor/github.com/varlink | |
parent | 03cf4ac60af463cd82af65fd5846fdea1c3e7e62 (diff) | |
download | podman-7965bf54048044d63f967d2b4ce8efe1e1072f05.tar.gz podman-7965bf54048044d63f967d2b4ce8efe1e1072f05.tar.bz2 podman-7965bf54048044d63f967d2b4ce8efe1e1072f05.zip |
podman-varlink: log timeouts
The default timeout of one second when using podman-varlink can confuse
users as podman exits in silence after this timeout in case no
connection to the endpoint is alive. Print a log (info level) that the
varlink service has expired to guide the user.
This change requires to vendor in the latest master of varlink/go.
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
Closes: #899
Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/varlink')
-rw-r--r-- | vendor/github.com/varlink/go/varlink/service.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/varlink/go/varlink/service.go b/vendor/github.com/varlink/go/varlink/service.go index c76c9b436..551ba4e53 100644 --- a/vendor/github.com/varlink/go/varlink/service.go +++ b/vendor/github.com/varlink/go/varlink/service.go @@ -51,6 +51,13 @@ type Service struct { address string } +// ServiceTimoutError helps API users to special-case timeouts. +type ServiceTimeoutError struct {} + +func (ServiceTimeoutError) Error() string { + return "service timeout" +} + func (s *Service) getInfo(c Call) error { return c.replyGetInfo(s.vendor, s.product, s.version, s.url, s.names) } @@ -297,7 +304,7 @@ func (s *Service) Listen(address string, timeout time.Duration) error { s.mutex.Lock() if s.conncounter == 0 { s.mutex.Unlock() - return nil + return ServiceTimeoutError{} } s.mutex.Unlock() continue |