[CDRIVER-4617] Explore alternatives to X macros in mongoc-rpc.c Created: 18/Apr/23  Updated: 28/Oct/23  Resolved: 26/Jun/23

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.24.0, 1.25.0

Type: Improvement Priority: Minor - P4
Reporter: Ezra Chung Assignee: Ezra Chung
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related

 Description   

The X macro pattern used by mongoc-rpc-private.h and mongoc-rpc.c to define structs and their corresponding gather/printf/swab_(to/from)_le/scatter functions has been a continued source of frustration when attempting to debug RPC function behavior. As we continue to improve OP_MSG support and move away from legacy opcodes, it may be worth refactoring this component to improve readability and the debugging experience.



 Comments   
Comment by Ezra Chung [ 26/Jun/23 ]

New mcd-rpc utilities introduced in 1.24.0 with corresponding libmongoc refactor.

Old mongoc-rpc utilities removed in 1.25.0.

Comment by Githook User [ 26/Jun/23 ]

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: CDRIVER-4617 Remove legacy mongoc-rpc entities (#1312)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/8126cd3a1108fde86f291f8d98d560200890bcec

Comment by Githook User [ 16/Jun/23 ]

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: CDRIVER-4617 Refactor libmongoc to use mcd-rpc (#1307)

  • Add mcd_rpc_message ingress/egress counter functions
  • Add mcd_rpc_message compression functions
  • Add mcd_rpc_message_get_body
  • Add mcd_rpc_message_check_ok
  • Refactor mongoc_cluster_t::request_id from uint32_t -> int32_t
  • Refactor mock server to use mcd-rpc
  • Refactor server monitor thread to use mcd-rpc
  • Refactor mongoc-async-cmd to use mcd-rpc
  • Refactor mongoc_cluster_run_command_opquery to use mcd-rpc
  • Refactor mongoc_cluster_run_opmsg to use mcd-rpc
  • Refactor cursor functions to use mcd-rpc
  • CDRIVER-4625 Address distinct pointer type warnings on Windows
Generated at Wed Feb 07 21:21:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.