aws / aws/amazon-documentdb-odbc-driver

Add locks on getLoggerInstance

Open
#175 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

If multiple threads try to get the logger instance, 2 logger instances might be created at the same time. This may or may not be an actual issue. Note that locks would impair the run time.

Example:

```C
// pseudo-code
getLoggerInstance() {
// get lock
if (!_logger)
_logger = new Logger();
// unlock
return _logger;
}
```

AC:

- add lock protection to getLoggerInstance

Contributor guide

Open the contributing guide

Research direction

Locate getLoggerInstance in the driver and inspect how the logger singleton is initialized. Add the requested lock protection, then verify that concurrent calls cannot create multiple logger instances and consider the runtime cost noted in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.