-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
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.
- is related to
-
PHPC-231 Manager instances should not free streams that are still in use
-
- Closed
-