[JAVA-506] Endless loop in saveChunks Created: 18/Jan/12  Updated: 18/Jun/12  Resolved: 24/Feb/12

Status: Closed
Project: Java Driver
Component/s: GridFS
Affects Version/s: 2.7.2
Fix Version/s: 2.8.0

Type: Bug Priority: Major - P3
Reporter: Achim Weigel Assignee: Daniel Gottlieb (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello,

we are using Java Driver version 2.7.2. When we are calling

GridFSInputFile.saveChunks( long chunkSize )

accidentally with a chunkSize of 0 the program goes into an endless loop over

while ( bytesRead >= 0 )

{...}

in that method consuming all CPU time.

Best Regards,
Achim



 Comments   
Comment by Jeffrey Yemin [ 18/Jun/12 ]

Closing for 2.8.0 release.

Comment by Daniel Gottlieb (Inactive) [ 24/Feb/12 ]

We now validate the (lower bound of the) chunkSize input when saving the file and will throw a MongoException on an invalid chunkSize in the same way that saving with a chunkSize that was too big always threw an exception.

Comment by auto [ 23/Feb/12 ]

Author:

{u'login': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'danny.gottlieb@gmail.com'}

Message: JAVA-506: ensure sane values for the chunkSize when saving a file to gridfs
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/f3031508b14f94d131cc8aef0f479c8549f9f6fb

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