Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-427

GridFS StreamWrapper should report EOF after an exception

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      As suggested in mongodb/mongo-php-library#608:

      Another change that might fix this, but that might well not be correct: if stream_eof() were to return true after such an error, that might solve the problem. For an exception, I'm not sure what is strictly correct for `eof`, but surely in the case of such an error, the user will never want to read anything else from the stream.

      https://www.php.net/manual/en/streamwrapper.stream-eof.php also states that the method:

      Should return TRUE if the read/write position is at the end of the stream and if no more data is available to be read, or FALSE otherwise.

      Consider having StreamWrapper::stream_eof() return true if some previous operation encountered an exception that would prevent an application from reading the GridFS file. Before implementing this, we'll need to determine how this interacts with forthcoming retryable read behavior (PHPC-1291).

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: