Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-609

Stream handlers need to differentiate between closing a stream due to error or normal cleanup

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2-beta0
    • Affects Version/s: 1.1.4
    • Component/s: None
    • None

      The stream handler expose a way to destruct (close (if needed) and free) a stream resource – but that doesn't tell you why it is requested at all.

      We need a way to differentiate between closing a stream due to error (e.g. connection failure, replicaset reconfigured without that node, invalid reply from server, ... ..) vs closing the stream due to normal cleanup routines (mongoc_destroy(), ...).

      The handling of these two cases is vastly different for language bindings, as in the first case the stream really needs to be killed dead - while in the second case it does not. The language binding may want to keep it around for other purposes – or resume it for next client.

      This is especially important for the PHP bindings as we implement "persistent streams" across requests (and manager – and background sdam checks).
      We don't want to destroy these stream when destroying a client (which happens after every request) as the next client (for the next request) will be requesting the same stream very shortly.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: