Skip to content

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Dec 19, 2023

Summary

Restore the enum value MONGOC_MD_FLAG_ENABLE_ICU.

I suggest reviewing individual commits.

Additional improvements

parse_handshake_cfg.py is updated to support Python 3.

Explicit assignments are added to enum values (e.g. MONGOC_MD_FLAG_TRACE = 30 instead of MONGOC_MD_FLAG_TRACE) to clarify the values are fixed.

Background & Motivation

CDRIVER-4680 removed the MONGOC_MD_FLAG_ENABLE_ICU from the handshake config.

The handshake config is reported in the client metadata sent to the server. Here are examples from the mongod logs (search for "cfg"):

{"t":{"$date":"2023-12-13T13:00:39.283-05:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn13","msg":"client metadata","attr":{"remote":"127.0.0.1:49998","client":"conn13","doc":{"driver":{"name":"mongoc","version":"1.24.3"},"os":{"type":"Darwin","name":"macOS","version":"21.6.0","architecture":"arm64"},"platform":"cfg=0x0300deaa65 posix=200112 stdc=199901 CC=clang 14.0.0 (clang-1400.0.29.202) CFLAGS=\"\" LDFLAGS=\"\""}}}
{"t":{"$date":"2023-12-13T13:00:39.374-05:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn14","msg":"client metadata","attr":{"remote":"127.0.0.1:50000","client":"conn14","doc":{"driver":{"name":"mongoc","version":"1.25.0"},"os":{"type":"Darwin","name":"macOS","version":"21.6.0","architecture":"arm64"},"platform":"cfg=0x0383d6aa65 posix=200112 stdc=199901 CC=clang 14.0.0 (clang-1400.0.29.202) CFLAGS=\"\" LDFLAGS=\"\""}}}

MONGOC_MD_FLAG_ENABLE_ICU was likely unintentionally removed. Removing shifted the subsequent values down one. This may add difficultly parsing and comparing config values between driver versions.

@kevinAlbs kevinAlbs marked this pull request as ready for review December 19, 2023 21:37
@kevinAlbs kevinAlbs requested a review from adriandole December 19, 2023 21:37
@kevinAlbs kevinAlbs merged commit 38f80af into mongodb:master Jan 2, 2024
kevinAlbs added a commit that referenced this pull request Jan 2, 2024
* support Python 3 in `parse_handshake_cfg.py`

* add numeric assignments to enum values

* format `mongoc-handshake-private.h`

* fix reference to test function

* restore `MONGOC_MD_FLAG_ENABLE_ICU`

* comment about `MONGOC_MD_FLAG_ENABLE_ICU` removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants