[CDRIVER-3322] Warning logged when destroying client pool if client pool, session created but not used Created: 15/Aug/19  Updated: 28/Oct/23  Resolved: 29/Jun/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.17.0-rc0, 1.17.0

Type: Bug Priority: Major - P3
Reporter: Kaitlin Mahar Assignee: Andrew Witten (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File Makefile     File main.c    

 Description   

If you do the following:

  • Create a client pool
  • Pop a client
  • Use that client to create a session
  • Destroy the session
  • Return the client to the pool
  • Destroy the pool

A warning is logged:

WARNING:       client: Couldn’t send “endSessions”: Could not find node 127.0.0.1:27017"

The warning is coming from the call to mongoc_cluster_stream_for_server in _mongoc_client_end_sessions.

This does not happen in single-threaded mode.

Haven't experienced any issues because of this, but it seems like the warning should not be logged in this case.

Repro code attached



 Comments   
Comment by Githook User [ 11/Jul/20 ]

Author:

{'name': 'Andrew Witten', 'email': 'andrew.witten@mongodb.com', 'username': 'awitten1'}

Message: CDRIVER-3322 only push used sessions

Comment by Githook User [ 07/Jul/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-1953 fix session test

After CDRIVER-3322, libmongoc no longer pools unused sessions.
Fixes a test that was relying on this behavior to use the session it is
expecting to pool.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/22a82b26ab755be5acb734d67d7390250244f8b8

Comment by Githook User [ 29/Jun/20 ]

Author:

{'name': 'Andrew Witten', 'email': 'andrew.witten@mongodb.com', 'username': 'awitten1'}

Message: CDRIVER-3322 only push used sessions

Comment by Andrew Witten (Inactive) [ 18/Jun/20 ]

PR: https://github.com/mongodb/mongo-c-driver/pull/640

Changes the following: does not push unused server sessions to session_pool to be reused; only pushes if server session has been used.  From the perspective of the server, the session does not exist.

Generated at Wed Feb 07 21:17:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.