-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Context
GODRIVER-3612 adds an API for users to create a session from a logical session ID. While session.Server associated with this LSID cannot be officially pooled, it would be useful to create a sentinel pool to control how improper use panics/throws errors. Particularly because future additions to session.Client that use the pool may cause undocumented panics for users creating such session:
type unpooledSessionPool struct {} var _ session.Pool = (*unpooledSessionPool)(nil) func(unpooledSessionPool) ReturnSession( _ *session.Server) { panic("EndSession called on unpooled LSID session (NewSessionWithID): not pooled") }
See TestNewSessionWithID/EndSession_panics for example.
Definition of done
Convert session.Pool to an interface and add a sentinel session to the mongointernal NewSessionWithID/LSID function.
Pitfalls
This is experimental API