Skip to content

Commit 60dab54

Browse files
committed
Possible fix for issue with infinite loop on read
1 parent 3a47160 commit 60dab54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

azure/datalake/store/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ def read(self, length=-1):
865865
data_read = self.cache[self.loc - self.start:
866866
min(self.loc - self.start + length, self.end - self.start)]
867867
out += data_read
868+
if len(data_read) == 0: # Check to catch possible server errors. Ideally shouldn't happen.
869+
break
868870
self.loc += len(data_read)
869871
length -= len(data_read)
870872
if self.loc >= self.size:

0 commit comments

Comments
 (0)