Remove context from GridFS stream objects

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Currently the GridFS stream objects GridFSUploadStream and GridFSDownloadStream maintain the context used to construct them as a field. This is rather dangerous and can lead to context misuse.

      Definition of done

      Open a Go Routine where the context is defined to cancel:

      ctx, cancel := context.WithDeadline()
      go func() {
          <-someCondition 
          cancel()
      }()
      

      Specifically, use the pattern defined when checking a server: https://github.com/mongodb/mongo-go-driver/blob/d55b4b93d81c1850e86fab66857eda8156d63aa0/x/mongo/driver/topology/server.go#L590

      Pitfalls

      NA

            Assignee:
            Unassigned
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: