SRV resolution is not thread-safe or fully windows compatible

Description

The current handling for SRV resolution involves our own custom implementation of a DNS client. This client only reads DNS config from the linux /etc/resolv.conf folder, and I'm not actually certain that configuration is actually used by the DNS client itself? Additionally, the initialization of the DNS configuration is done solely through an atomic boolean, and is performed synchronously, and thus multiple concurrent calls to the function could lead to a race or blocked asio executor.

Environment

None

Release Notes Description

None

Attachments

3

Activity

Show:

Jared Casey October 27, 2022 at 9:47 PM

added use of std::once_flag, so SRV resolution should be thread safe now.

I have attached some logs with some testing as I don't know how we can easily test this in an automated fashion (maybe eventually w/in QE).

  •  

  • - basic Python script hitting a local DNS setup (see below) that ultimately directs to a Couchbase cluster in AWS.

  •  

  • - basic Python script hitting a local DSN setup (see below) and working with Capella.

  •  

  • - basic Python script hitting Capella via the default DNS setup for my Windows instance.

DNS Setup
Using coredns, Corefile and zone file below.

Corefile

Zone file

Ray Cardillo September 6, 2022 at 3:32 PM

I've added this to the Serverless Support Epic because it's tangentially related because of the new DNS SRV refresh required.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Sprint

Story Points

Fix versions

Affects versions

Priority

Instabug

Open Instabug

Sentry

Zendesk Support

Created February 23, 2022 at 12:14 AM
Updated November 2, 2022 at 5:02 PM
Resolved November 1, 2022 at 7:49 AM
Instabug