BrokenPipeError: [Errno 32] Broken pipe InfluxDB 1.5.1 writing

I have script that select information from sql database and inject into influxdb.
I have several InfluxDB installations on old InfluxDB 1.3.7 and latest InfluxDB 1.5.1.
Part of influx dependent code here:
dbname = ‘oracle’
client = InfluxDBClient(host=‘localhost’,
port=8086,
database=dbname)
client.create_database(dbname)

class MySeries(SeriesHelper):
    class Meta:
        client = client
        series_name = 'cpu'
        fields = ['time',
                  'Field1',
                  'Field2',
                  'Field3',
                  'Field4']
        tags = ['TaggedField1',
                'TaggedField2',
                'TaggedField3']
        bulk_size = 330000
        autocommit = True
...
def move_to_influx(query):
    ...
    try:
        with connection.cursor() as cursor:
            cursor.execute(query)
            ...
            for row in cursor:
                date_str = str(row['Timestamp'])
                dt_obj = datetime.strptime(date_str,
                                           "%Y-%m-%d %H:%M:%S")
                MySeries(time=dt_obj,
                       Field1=row['Field1'],
                       Field2=row['Field2'],
                       Field3=row['Field3'],
                       Field4=row['Field4'],
                       TaggedField1=row['TaggedField1'],
                       TaggedField2=row['TaggedField2'],
                       TaggedField3=row['TaggedField3'])
            MySeries.commit()
    finally:
        connection.close()
...

When performing second iteration with MySeries.commit() script exits with error:

Traceback (most recent call last):
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 936, in _send_output
    self.send(message_body)
  File "/usr/lib/python3.5/http/client.py", line 908, in send
    self.sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/util/retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1107, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 936, in _send_output
    self.send(message_body)
  File "/usr/lib/python3.5/http/client.py", line 908, in send
    self.sock.sendall(data)
urllib3.exceptions.ProtocolError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "marinflux.py", line 113, in <module>
    main()
  File "marinflux.py", line 108, in main
    transit(query)
  File "marinflux.py", line 81, in transit
    AcctRc.commit()
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/influxdb/helper.py", line 146, in commit
    rtn = client.write_points(cls._json_body_())
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/influxdb/client.py", line 468, in write_points
    tags=tags, protocol=protocol)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/influxdb/client.py", line 532, in _write_points
    protocol=protocol
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/influxdb/client.py", line 312, in write
    headers=headers
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/influxdb/client.py", line 252, in request
    timeout=self._timeout
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/home/ivanov/mysql_to_influx/lib/python3.5/site-packages/requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))

Python script is executed on the same server InfluxDB 1.5.1.
When pointing script to another influx server, in my case 1.3.1, it runs without any problems up to end.
Maybe it is not the version issue but help please with ideas to further debug this exception.
Both InfluxDB configurations are the same.

I am having a similar problem where I ingest data using python dataframes and seem to blow out some connection in urllib3:

    Traceback (most recent call last):
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    20:32:59 chunked=chunked)
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    20:32:59 conn.request(method, url, **httplib_request_kw)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    20:32:59 self._send_request(method, url, body, headers, encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    20:32:59 self.endheaders(body, encode_chunked=encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    20:32:59 self._send_output(message_body, encode_chunked=encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1065, in _send_output
    20:32:59 self.send(chunk)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 986, in send
    20:32:59 self.sock.sendall(data) 
    20:32:59 BrokenPipeError: [Errno 32] Broken pipe
    20:32:59 During handling of the above exception, another exception occurred:
    20:32:59 Traceback (most recent call last):
    20:32:59 File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    20:32:59 timeout=timeout
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    20:32:59 _stacktrace=sys.exc_info()[2])
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment
    20:32:59 raise six.reraise(type(error), error, _stacktrace)
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py", line 685, in reraise
    20:32:59 raise value.with_traceback(tb)
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    20:32:59 chunked=chunked)
    20:32:59 File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    20:32:59 conn.request(method, url, **httplib_request_kw)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    20:32:59 self._send_request(method, url, body, headers, encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    20:32:59 self.endheaders(body, encode_chunked=encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    20:32:59 self._send_output(message_body, encode_chunked=encode_chunked)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 1065, in _send_output
    20:32:59 self.send(chunk)
    20:32:59 File "/usr/local/lib/python3.6/http/client.py", line 986, in send
    20:32:59 self.sock.sendall(data)
    20:32:59 urllib3.exceptions.ProtocolError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))

Huh, thanks for info.
But looks that forum is mostly dead. :thinking:
Next my idea is to create pure json for bulk insertion:

    if iteration_accept == 330000:
        dbname = 'example'
        client = InfluxDBClient(host='192.168.0.100',
                                port=8086,
                                database=dbname)
        client.create_database(dbname)
        client.write_points(series_helper._json_body)

        print('Writing points to database %s' % dbname)
        series_helper.clear_json_body()
        iteration_accept = 0

And this is failing too with broken pipe even with value 200000.
Maybe data for insertion is too big?