[CDRIVER-1513] Why is handshake metadata global? Created: 31/Aug/16  Updated: 11/Sep/19  Resolved: 31/Aug/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Task Priority: Major - P3
Reporter: David Golden Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Having driver handshake metadata global means that there can only be one definition of driver name & version.

Theoretically, what if a program used both the C and C++ driver? First one to set metadata wins?

Why is having global state better than having metadata options provided to the construction of client/pool?



 Comments   
Comment by Hannes Magnusson [ 31/Aug/16 ]

I'm not sure I understand your suggestion.

The data isn't something that the user is supposed to provide, therefore its not part of the client constructors.

Also, the data doesn't change. The version and os and everything is the same, so no need to be doing this dance multiple dance per thread or what not.

I don't think a program linking and using both C++11 and mongoc separately is a worry. We already have other global states that would breakdown before this becoming an issue

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