Skip to content

Commit

Permalink
Merge pull request #4 from aliyun/bugfix/tunnel_realloc_iobuffer
Browse files Browse the repository at this point in the history
Fix a tunnel bug which yields when uploading records using compression
  • Loading branch information
qinxuye committed Feb 13, 2016
2 parents cd90a99 + e3d3160 commit b05da7e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions odps/tunnel/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def write(self, data):
def __init__(self, compress_option=None, buffer_size=None, encoding='utf-8'):
self._buffer = ProtobufWriter._get_buffer(compress_option)
self._queue = Queue.Queue()

self._compress_option = compress_option
self._buffer_size = buffer_size or self.BUFFER_SIZE
self._curr_cursor = 0
self._n_total = 0
Expand Down Expand Up @@ -115,8 +115,7 @@ def flush(self):
self._buffer.flush()
if self._curr_cursor > 0:
self._queue.put(self._buffer.getvalue())
self._buffer = compat.BytesIO()

self._buffer = ProtobufWriter._get_buffer(self._compress_option)
self._curr_cursor = 0

def close(self):
Expand Down

0 comments on commit b05da7e

Please sign in to comment.