[CDRIVER-731] Custom log handler cannot capture tracing on sasl_set_mutex callbacks Created: 01/Jul/15  Updated: 17/Aug/15  Resolved: 06/Jul/15

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.1.9, 1.2.0
Fix Version/s: 1.2-beta0

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-306 Check for sasl_client_done when gener... Closed
Related
is related to CDRIVER-547 inappropriate use of sasl_client_init... Closed

 Description   

Since c3c14f4 in the 1.1.x branch, entry/exit tracing apppears on SASL mutex callbacks that are initalized in MONGOC_ONCE_FUN() in mongoc-init.c. MONGOC_ONCE_FUN() is in turn called before any custom log handlers can be configured, which means output like the following ends up on stderr before a user of the driver can capture it elsewhere:

2015/07/01 15:59:13.0495: [  441]:    TRACE:       mongoc: ENTRY: mongoc_sasl_mutex_alloc():40
2015/07/01 15:59:13.0495: [  441]:    TRACE:       mongoc:  EXIT: mongoc_sasl_mutex_alloc():45
2015/07/01 15:59:13.0496: [  441]:    TRACE:       mongoc: ENTRY: mongoc_sasl_mutex_alloc():40
2015/07/01 15:59:13.0496: [  441]:    TRACE:       mongoc:  EXIT: mongoc_sasl_mutex_alloc():45

Looking at other code invoked by the init methods, I see that the SSL and SCRAM init functions don't use any tracing, nor are there any tests for trace output for these SASL mutex functions. Should we simply remove the traces, or is there a more elaborate solution to be considered?



 Comments   
Comment by Githook User [ 05/Aug/15 ]

Author:

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

Message: Merge branch 'master' into 1.2.0-dev

  • master: (38 commits)
    various fixups for memory leaks and races in tests
    Fix memory leak in mongoc_uri_parse_option
    post-release bump
    1.1.10 Release
    CDRIVER-755 leaks in _mongoc_cluster_ismaster
    CDRIVER-745 test cluster node destroy, then disconnect
    CDRIVER-750 don't query recovering RS members
    spell "cyrus" correctly in install guide
    CDRIVER-745 crash in _mongoc_cluster_disconnect_node
    post-release bump
    CDRIVER-731: Do not trace SASL mutex callbacks
    debian changelog fixes for deb pkg
    1.1.9 Release
    redundant include
    CDRIVER-721 test reconnection
    CDRIVER-727 actually enable coverage in libmongoc
    update libbson to 1.1.9-dev
    CDRIVER-721 test rs and mongos, connected and not
    CDRIVER-721 additional tests
    CDRIVER-721 mongoc_client_destroy crash after connection fails
    ...

Conflicts:
CMakeLists.txt
NEWS
README.rst
build/autotools/Versions.m4
build/rpm/mongo-c-driver.spec
debian/changelog
doc/installing.page
doc/mongoc_version.page
src/libbson
src/mongoc/mongoc-cluster-private.h
src/mongoc/mongoc-cluster.c
src/mongoc/mongoc-read-prefs.c
src/mongoc/mongoc-uri.c
src/mongoc/mongoc-write-command.c
tests/mock-server.c
tests/mock-server.h
tests/test-libmongoc.c
tests/test-mongoc-client.c
tests/test-mongoc-cluster.c
tests/test-mongoc-database.c
tests/test-mongoc-read-prefs.c
tests/test-mongoc-uri.c
tests/test-sasl.c
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/e62117d12a600f6cf61eb409933af6f92a3d7c22

Comment by Githook User [ 05/Aug/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #246 from jmikola/patch-1

CDRIVER-731: Do not trace SASL mutex callbacks
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/4282e7498ac92777ba8a6693de691641eb63afe6

Comment by Githook User [ 05/Aug/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-731: Do not trace SASL mutex callbacks

These callbacks may be invoked before users have a chance to set their own log handler, so we should avoid tracing them (akin to the SSL and SCRAM init functions).
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/0da62cf461b815fb0501b2f23b084583b58e4dca

Comment by A. Jesse Jiryu Davis [ 06/Jul/15 ]

jmikola you can resolve (but not close) this.

Comment by Githook User [ 06/Jul/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #246 from jmikola/patch-1

CDRIVER-731: Do not trace SASL mutex callbacks
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/4282e7498ac92777ba8a6693de691641eb63afe6

Comment by Githook User [ 06/Jul/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-731: Do not trace SASL mutex callbacks

These callbacks may be invoked before users have a chance to set their own log handler, so we should avoid tracing them (akin to the SSL and SCRAM init functions).
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0da62cf461b815fb0501b2f23b084583b58e4dca

Comment by Jeremy Mikola [ 01/Jul/15 ]

PR for consideration: https://github.com/mongodb/mongo-c-driver/pull/246

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