Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-11443

Python stream client does not reuse socket connection in all cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: CDAP Clients, Streams
    • Labels:
      None
    • Rank:
      1|i0013r:

      Description

      While using cdap stream client, the following error can be hit. This is very likely due to TCP/IP port exhaustion.
      The python stream client is leveraging the requests module, and in order to reuse sockets, we need to consume the response body (http://docs.python-requests.org/en/latest/user/advanced/#keep-alive).

      Traceback (most recent call last):
        File "..\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 594, in urlopen
          chunked=chunked)
        File "..\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 361, in _make_request
          conn.request(method, url, **httplib_request_kw)
        File "..\lib\http\client.py", line 1239, in request
          self._send_request(method, url, body, headers, encode_chunked)
        File "..\lib\http\client.py", line 1285, in _send_request
          self.endheaders(body, encode_chunked=encode_chunked)
        File "..\lib\http\client.py", line 1234, in endheaders
          self._send_output(message_body, encode_chunked=encode_chunked)
        File "..\lib\http\client.py", line 1026, in _send_output
          self.send(msg)
        File "..\lib\http\client.py", line 964, in send
          self.connect()
        File "..\lib\site-packages\requests\packages\urllib3\connection.py", line 163, in connect
          conn = self._new_conn()
        File "..\lib\site-packages\requests\packages\urllib3\connection.py", line 147, in _new_conn
          self, "Failed to establish a new connection: %s" % e)
      requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x000001DD3CE3F1D0>: Failed to establish a new connection: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
      

      Related: https://msdn.microsoft.com/en-us/library/aa560610(v=bts.20).aspx

        Attachments

          Activity

            People

            • Assignee:
              bhooshan Bhooshan Mogal
              Reporter:
              ali.anwar Ali Anwar
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: