提交 b275a95d 编写于 作者: Y yuuji.yaginuma

Call `MonitorMixin` initializer before use methods provided by `MonitorMixin`

`MonitorMixin` setup internal variables in `initialize`, so need to call
that before use.
`ActionController::Live::Buffer` only use methods that do not depend on those
internal variables, so works expertly.

But since Ruby 2.7, methods that were not originally the case also depend on
internal variables. As a result, some tests fail in Ruby 2.7.
https://buildkite.com/rails/rails/builds/65193#02e136eb-edea-4367-aee0-77e0a82f8531/990-1200

I'm not sure if this should be considered Ruby incompatible, but I fixed
this because its usage is wrong.

Related to [Feature #16255: Make `monitor.rb` built-in](https://bugs.ruby-lang.org/issues/16255)
上级 bdc9dc6c
......@@ -136,11 +136,11 @@ class Buffer < ActionDispatch::Response::Buffer #:nodoc:
attr_accessor :ignore_disconnect
def initialize(response)
super(response, SizedQueue.new(10))
@error_callback = lambda { true }
@cv = new_cond
@aborted = false
@ignore_disconnect = false
super(response, SizedQueue.new(10))
end
def write(string)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册