While trying to download files from google drive concurrently using concurrent.futures module the below script throwing malloc(): unsorted double linked list corrupted.
files = [
{"id": "2131easd232", "name": "image1.jpg"},
{"id": "2131easdfsd232", "name": "image2.jpg"},
{"id": "2131ea32cesd232", "name": "image3.jpg"}
]
def download_file(data):
request = drive_service.files().get_media(fileId=data['id'])
fh = io.FileIO(data['name'], 'wb')
downloader = MediaIoBaseDownload(fh, request)
done = False
while done is False:
status, done = downloader.next_chunk()
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(download_file, files)
malloc(): unsorted double linked list corrupted Aborted (core dumped)
The script get executed fast (within 2 seconds) and only junk files ( files with size 0bytes ) getting created. BUt i am able to download the files synchronously without any interrupt.