[GODRIVER-1013] When reading whole file at once next read doesn't return EOF Created: 01/May/19  Updated: 28/Oct/23  Resolved: 13/Jun/19

Status: Closed
Project: Go Driver
Component/s: GridFS
Affects Version/s: 1.0.1
Fix Version/s: 1.0.4

Type: Bug Priority: Major - P3
Reporter: Sławomir Chmiel Assignee: Emmanuel Eppinger (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongodb 3.6.12
ubuntu 18.04


Attachments: File main.go    
Issue Links:
Backports
backported by GODRIVER-1140 Backport "When reading whole file at ... Closed

 Description   

See attached main.go file:

  • it stored 1024 bytes of random data to the database
  • then it loads the whole file (all the 1024 bytes) at once
  • after that when calling Read on DownloadStream it returns 0 bytes read and no error
  • another call results with 0 bytes read and EOF error

I would expect that second call of Read should return (0, EOF) as the first one already read all the data.



 Comments   
Comment by Githook User [ 14/Jun/19 ]

Author:

{'name': 'Emmanuel', 'email': 'manny.eppinger@mongodb.com', 'username': 'eppingere'}

Message: Next read after read full file returns EOF

GODRIVER-1013

Fix bug in DownloadStream and add RoundTrip tabular tests that test
these bugs

Change-Id: I73777b5b422fdf0bfdee344fb08c2f686940ccd8
Branch: release/1.0
https://github.com/mongodb/mongo-go-driver/commit/e64ebe34f283d713270bff03192c8b4bd782d3d7

Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'Emmanuel', 'email': 'manny.eppinger@mongodb.com', 'username': 'eppingere'}

Message: Next read after read full file returns EOF

GODRIVER-1013

Fix bug in DownloadStream and add RoundTrip tabular tests that test
these bugs

Change-Id: I73777b5b422fdf0bfdee344fb08c2f686940ccd8
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/9b4581cfb6ed0a86b61dac77843db053dc02a81e

Comment by Emmanuel Eppinger (Inactive) [ 13/Jun/19 ]

https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/457658

Generated at Thu Feb 08 08:35:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.