[elbe-devel] [PATCH v3] soapclient: workaround socket exception

Manuel Traut manut at linutronix.de
Wed Sep 12 16:21:22 CEST 2018


oops, git send-email miss-use. This is another patch, that i just wanted to
test before posting. Please ignore.

On Wed, Sep 12, 2018 at 04:18:31PM +0200, Manuel Traut wrote:
> maybe the reset occurs, because the initvm is to busy to answer the SOAP
> request in time. Try to ignore this issue by retrying getting the same
> part of the log.
> 
> 17:32:00 2018-08-30 15:29:09 - INFO     - | Traceback (most recent call last):
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "./elbe", line 55, in <module>
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     cmdmod.run_command(sys.argv[2:])
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/home/elbe/elbepack/commands/control.py", line 161, in run_command
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     action.execute(control, opt, args[1:])
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/home/elbe/elbepack/soapclient.py", line 571, in execute
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     busy = client.service.get_project_busy(builddir, part)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/client.py", line 566, in __call__
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     return client.invoke(args, kwargs)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/client.py", line 705, in invoke
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     result = self.send(soapenv)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/client.py", line 747, in send
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     reply = self.options.transport.send(request)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/transport/https.py", line 66, in send
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     return HttpTransport.send(self, request)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/transport/http.py", line 80, in send
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     fp = self.u2open(u2request)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/dist-packages/suds/transport/http.py", line 127, in u2open
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     return url.open(u2request, timeout=tm)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/urllib2.py", line 429, in open
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     response = self._open(req, data)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/urllib2.py", line 447, in _open
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     '_open', req)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     result = func(*args)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     return self.do_open(httplib.HTTPConnection, req)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/urllib2.py", line 1201, in do_open
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     r = h.getresponse(buffering=True)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/httplib.py", line 1121, in getresponse
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     response.begin()
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/httplib.py", line 438, in begin
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     version, status, reason = self._read_status()
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/httplib.py", line 394, in _read_status
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     line = self.fp.readline(_MAXLINE + 1)
> 17:32:00 2018-08-30 15:29:09 - INFO     - |   File "/usr/lib/python2.7/socket.py", line 480, in readline
> 17:32:00 2018-08-30 15:29:09 - INFO     - |     data = self._sock.recv(self._rbufsize)
> 17:32:00 2018-08-30 15:29:09 - INFO     - | socket.error: [Errno 104] Connection reset by peer
> 17:32:00 2018-08-30 15:29:09 - INFO     - | WARNING: exit code 1 from a shell command.
> 17:32:00 2018-08-30 15:29:09 - INFO     - | ERROR: Function failed: do_rootfs (log file is located at /home/build/tmp-glibc/work/cortexa9hf-neon-oe-linux-gnueabi/image1/1.0-r0/temp/log.do_rootfs.10761)
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> ---
> 
> changes since v2:
> 
>   * add variable to store exception in, otherwise an unitialized variable 'e'
>       will be used
> 
>  elbepack/soapclient.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
> index fbb29a97..825f405e 100644
> --- a/elbepack/soapclient.py
> +++ b/elbepack/soapclient.py
> @@ -567,7 +567,14 @@ class WaitProjectBusyAction(ClientAction):
>          part = 1
>  
>          while True:
> -            busy = client.service.get_project_busy(builddir, part)
> +            try:
> +                busy = client.service.get_project_busy(builddir, part)
> +            except socket.error as e:
> +                print("socket error during wait busy occured, retry..",
> +                      file=sys.stderr)
> +                print(e.message)
> +                continue
> +
>              if busy == 'FINISH':
>                  break
>              else:
> -- 
> 2.19.0.rc2
> 



More information about the elbe-devel mailing list