[CDRIVER-1504] Provide a way to suppress mongoc warning message for counters Created: 30/Aug/16  Updated: 20/Sep/16  Resolved: 20/Sep/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.3.3
Fix Version/s: 1.4.1, 1.5.0

Type: Improvement Priority: Minor - P4
Reporter: Tanmoy Palit Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Red Hat Linux



 Description   

We need to suppress the following warning message from going out to stdout
WARNING: mongoc: Falling back to malloc for counters.

Currently we are disabling mongo-c performance counters by default (by setting MONGOC_DISABLE_SHM) but because of that users are seeing the warning message on the console and we would like to suppress that.

It will fine even if the fix is available in later version of the Mongo C Driver.



 Comments   
Comment by A. Jesse Jiryu Davis [ 20/Sep/16 ]

Cherry-picked to r1.4 branch: https://github.com/mongodb/mongo-c-driver/commit/8c6ae3f1de36953a36e6c599d467b0300e6e7982

Comment by Githook User [ 20/Sep/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1504 Don't warn when intentionally disabled
Branch: r1.4
https://github.com/mongodb/mongo-c-driver/commit/8c6ae3f1de36953a36e6c599d467b0300e6e7982

Comment by Githook User [ 31/Aug/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1504 Don't warn when intentionally disabled
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/48c4bd710db66a5232e3b7ad4c76f45a42e47dfd

Comment by Tanmoy Palit [ 30/Aug/16 ]

Thanks.
We have our own data distribution which resides in the shared-memory of a cluster environment.
Mongo shm counters are turned off just to be safe so that it does not create additional files in shared memory.

Comment by Hannes Magnusson [ 30/Aug/16 ]

Yes, --disable-shm-counters will not compile them in at all, so the codepath is much simplified then disabling them at runtime, which erroneously winds up printing that warning.

Out of curiosity, why are you disabling them? They shouldn't have any affect on the use of the driver, so I'm curious why you'd disable them

Comment by Tanmoy Palit [ 30/Aug/16 ]

Just to clarify, so I can build 1.3.3 driver with --disable-shm-counters options to disable the message. I don't need latest driver version right?

Comment by Hannes Magnusson [ 30/Aug/16 ]

If you have no need for them, you can configure the driver with --disable-shm-counters.

That warning isn't particularly useful, we should probably remove it

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