When establishing a connection to an SMTP server, Net::SMTP doesn't offer a way to specify a timeout for how long the TLS handshake should take. In our production environment, this means we routinely see hangs under this callstack: ...benweint (Ben Weintraub)
When booting a newly-initialized Rails 4.2.1 app under Ruby 2.2.2 with `GC.stress` enabled, I get a repeatable crash. The same crash happens at least as far back as 2.1.4 (haven't tried any earlier versions). Steps to reproduce: 1....benweint (Ben Weintraub)
The original test case was not actually minimal (there's no need to attempt to re-acquire the lock in the forked child process in order to demonstrate the issue), so I'm attaching an updated version.benweint (Ben Weintraub)
If a Ruby thread calls `Process.fork` while holding a Mutex (for example, within a `Mutex#synchronize` block) that is also concurrently being contended for by a background thread, the thread in the child process will occasionally be unab...benweint (Ben Weintraub)
One minor follow-up: it's actually not that getrusage takes a 'long' time (relative to the cost of each lazy sweep invocation), it's the dtrace probes themselves firing. The conclusion remains the same, though GC::Profiler seems correct.benweint (Ben Weintraub)
I think I've figured out the discrepancy here: the dtrace probes wrap around the getrusage(2) calls that GC::Profiler bases its timings on for Mac OS X. The average lazy sweep time is quite short (single-digit microseconds per lazy sweep...benweint (Ben Weintraub)
I realized that these are actually measuring different things: dtrace's timestamps measure wall clock time, whereas GC::Profiler on Mac OS X uses getrusage, which measures user CPU time. It still seems weird that the two would be so dive...benweint (Ben Weintraub)
Worth noting: a quick read through gc.c suggested that the missing GC sweep time might be due to me not having built with GC_PROFILE_MORE_DETAIL, but even after building with that, I still see the same discrepancy where GC::Profiler is s...benweint (Ben Weintraub)
I'm trying to square the numbers that I'm getting from GC::Profiler.total_time against those that I'm getting out of instrumentation with the GC dtrace probes embedded in Ruby, and having a hard time getting the two sources to agree. ...benweint (Ben Weintraub)