Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change the WriteSyncer to use lock when piping #1608

Merged

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #1607

Description

This PR wraps the pipe WriteSyncer with a Lock so that is can be used concurrently.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

make test

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added bug Something isn't working area/logging Related to the logging/logger system labels Jul 4, 2023
@fredcarle fredcarle requested a review from a team July 4, 2023 14:46
@fredcarle fredcarle self-assigned this Jul 4, 2023
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I cant really review other than by reading the zap-docs, which I assume you have already done :) Nice find and fix :)

@fredcarle
Copy link
Collaborator Author

LGTM, although I cant really review other than by reading the zap-docs, which I assume you have already done :) Nice find and fix :)

Thank Andy. Yes I tested it with Islam's PR and it solves the issue. Found the fix when I landed on this: uber-go/zap#106

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03 ⚠️

Comparison is base (97873c5) 73.62% compared to head (51dc94d) 73.59%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1608      +/-   ##
===========================================
- Coverage    73.62%   73.59%   -0.03%     
===========================================
  Files          188      188              
  Lines        19608    19608              
===========================================
- Hits         14435    14430       -5     
- Misses        4108     4112       +4     
- Partials      1065     1066       +1     
Flag Coverage Δ
all-tests 73.59% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
logging/logger.go 80.20% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97873c5...51dc94d. Read the comment docs.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fredcarle fredcarle merged commit 5f4beb9 into sourcenetwork:develop Jul 4, 2023
10 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/I1607-logger-pipe branch July 4, 2023 15:04
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1607

## Description

This PR wraps the pipe WriteSyncer with a Lock so that is can be used
concurrently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging Related to the logging/logger system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using pipe for logger in tests can result in a race condition
3 participants