Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

fix: fix racy conditions during shutdown #250

Merged
merged 5 commits into from
Mar 17, 2020
Merged

fix: fix racy conditions during shutdown #250

merged 5 commits into from
Mar 17, 2020

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Mar 17, 2020

We were checking if the completion queue was shutdown and then
scheduling work, but not atomically.


This change is Reviewable

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 17, 2020
@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #250 into master will increase coverage by 0.02%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #250      +/-   ##
==========================================
+ Coverage   95.78%   95.81%   +0.02%     
==========================================
  Files         101      101              
  Lines        4648     4657       +9     
==========================================
+ Hits         4452     4462      +10     
+ Misses        196      195       -1
Impacted Files Coverage Δ
google/cloud/internal/completion_queue_impl.cc 85.48% <ø> (-1.01%) ⬇️
google/cloud/completion_queue_test.cc 94.66% <100%> (+0.43%) ⬆️
google/cloud/completion_queue.cc 100% <100%> (ø) ⬆️
google/cloud/completion_queue.h 100% <100%> (ø) ⬆️
google/cloud/internal/async_read_stream_impl.h 66.12% <60%> (-2.45%) ⬇️
google/cloud/internal/completion_queue_impl.h 97.43% <92.85%> (-2.57%) ⬇️

Continue to review full report at Codecov.

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

coryan added 5 commits March 17, 2020 16:30
Write a test to reproduce the problem.
We were checking if the completion queue was shutdown and then
scheduling work, but not atomically.
@coryan coryan marked this pull request as ready for review March 17, 2020 21:15
Copy link
Contributor

@mr-salty mr-salty left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 6 files at r1, 4 of 4 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @devbww, @devjgm, and @scotthart)

@coryan coryan merged commit 3d5fe45 into googleapis:master Mar 17, 2020
@coryan coryan deleted the fix-race-in-cq-shutdown branch March 17, 2020 21:35
coryan added a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#250)

* bug: fix race condition during shutdown

We were checking if the completion queue was shutdown and then
scheduling work, but not atomically.
coryan added a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#250)

* bug: fix race condition during shutdown

We were checking if the completion queue was shutdown and then
scheduling work, but not atomically.
coryan added a commit to coryan/google-cloud-cpp that referenced this pull request Apr 24, 2020
…-common#250)

* bug: fix race condition during shutdown

We were checking if the completion queue was shutdown and then
scheduling work, but not atomically.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants