-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make GC stress usable with Libraries tests #103738
Changes from all commits
2a033d4
9e60f36
ca12724
9cd4655
99161b8
06a9087
207d72b
e8a2e9e
3b7cac2
db84183
f542fd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,6 +569,17 @@ void FinalizerThread::FinalizerThreadWait() | |
|
||
EnableFinalization(); | ||
|
||
hEventFinalizerDone->Wait(INFINITE,TRUE); | ||
// Under GC stress the finalizer queue may never go empty as frequent | ||
// GCs will keep filling up the queue with items. | ||
// We will disable GC stress to make sure the current thread is not permanently blocked on that. | ||
GCStressPolicy::InhibitHolder iholder; | ||
|
||
//---------------------------------------------------- | ||
// Do appropriate wait and pump messages if necessary | ||
//---------------------------------------------------- | ||
|
||
DWORD status; | ||
status = hEventFinalizerDone->Wait(INFINITE,TRUE); | ||
_ASSERTE(status == WAIT_OBJECT_0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This place does not complain about unused local. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I have seen before that this can break the build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the other case is included somewhere that is built with more strict rules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is that this does not complain because I would not hurt to change this one to the make-compiler-happy pattern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may have quite a few of these. Fixed this one. |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InhibitHolder increments global counter without using Interlocked. We may want to fix to avoid race conditions that can make this inhibit holder ineffective intermittently and cause hangs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not realize that. This is dangerous and may be already causing some rare failures in stress.