-
Notifications
You must be signed in to change notification settings - Fork 350
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
sass --embedded doesn't reliably exit when closing stdin #2001
Comments
I also have issue on Linux on GitHub Actions. In my case it looks like a lockup that randomly happens in the middle of the test. On Windows and Mac CI it never happened. Somehow I cannot reproduce it on my local Linux box. On GitHub Actions it happens on Ubuntu runner about every 10 tests. I ran the same test in a loop for one hour on my local Linux box and it never happens. As for the shutdown issue @bep is facing, it never happened for me. I suspect there might be some Linux specific bugs in Dart VM itself. |
@ntkme I initially reported this as a "Ubuntu issue", but I have since had this issue on MacOS, too (on GitHub). I have worked around this by sending an interrupt to the process on GOOS != "windows". |
OK. I finally got to the bottom of the lockup I'm facing, it is a race condition: #2004 |
@bep I have double checked and
|
If I read your test correctly you are sending lots of requests and shutting down while requests are still inflight? From what I can tell if the stdin is closed after all requests are completed, the compiler does shutdown correctly. |
I can confirm the same bug in ruby host as well. Here is a reliable reproduction: # frozen_string_literal: true
require 'sass-embedded'
embedded = Sass::Embedded.new
threads = []
10.times do
threads << Thread.new do
puts embedded.compile_string(
'a { b: foo() }',
functions: {
'foo()' => lambda do |*|
Sass::Value::Null::NULL
end
}
).css
rescue StandardError => e
puts e
end
end
puts 'closing'
embedded.close
puts 'closed'
threads.each(&:join) |
This is a race condition during shutdown, see #2007. |
That's correct, it's a race/robustness test on my side, but I can envision how certain server applications would not care too much about inflight requests when shutting down. Also, this implementation is behaving exactly like the official Go RPC library in this department: On |
I have migrated godartsass to v2 of the protocol, which was mostly smooth sailing.
But I have one test that is now flaky (fails about 50% of the time). I never had this test fail on dart-sass-embedded.
The short story is that I
stdin
The text was updated successfully, but these errors were encountered: