週刊Railsウォッチ(20190902)Ruby 2.6.4セキュリティ修正リリース、スライド「All About Ruby in 2019」、Shrine gem 3.0に入る新機能ほか

こんにちは、hachi8833です。ついさっきruby-jp Slackのワークスペースアイコン↓が見ている目の前で突然変わってびっくりしました😳。おめでとうございます!🎉 その後ちょっぴりリサイズしたようです↓。 各記事冒頭には⚓でパーマリンクを置いてあります: 社内やTwitterでの議論などにどうぞ 「つっつきボイス」はRailsウォッチ公開前ドラフトを(鍋のように)社内有志でつっついたときの会話の再構成です👄 毎月第一木曜日に「公開つっつき会」を開催しています: お気軽にご応募ください ※今回のウォッチは分割していません ※今回のつっつきはSlackベースで行いました ⚓週刊Railsウォッチ「公開つっつき会」第14回のお知らせ(無料) お申込み: 週刊Railsウォッチ公開つっつき会 第14回|IT勉強会ならTECH PLAY[テックプレイ] 第14回目公開つっつき会は、9月5日(木)19:30〜にBPS会議スペースにて開催されます。皆さまのお気軽なご参加をお待ちしております🙇。 ⚓Rails: 先週の改修(Rails公式ニュースより) 公式の更新情報のほとんどを先週の「先週の改修」で先取りしていました😋。今回も6-0-stableの更新を中心に見てみました。 他に、6.0.1マイルストーンのclosedからも見繕いました。 ⚓(6-0-stable、master)fork後にConnectionPool::Reaperが親のコネクションを刈り取る問題を修正 PR: Fix `ConnectionPool::Reaper` reaping parent connection pool after fork. by tgxworld · Pull Request #37002 · rails/rails 先週の#36999や#36998に関連していそうです。また「attr_reader :poolsに依存しないようにした」ともあります。 # activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L332 private def spawn_thread(frequency) Thread.new(frequency) do |t| running = true while running sleep t @mutex.synchronize do – @pools[frequency].select!(&:weakref_alive?) + @pools[frequency].select! do |pool| + pool.weakref_alive? && !pool.discarded? + end + @pools[frequency].each do |p| p.reap p.flush rescue WeakRef::RefError end if @pools[frequency].empty? @pools.delete(frequency) @threads.delete(frequency) running = false end end end end end … def discard! # :nodoc: synchronize do – return if @connections.nil? # already discarded + return if self.discarded? @connections.each do |conn| conn.discard! end @connections = @available = @thread_cached_conns = nil end end + def discarded? # :nodoc: + @connections.nil? + end … つっつきボイス:「この辺はGC系とかも絡んでいるようでデバッグが大変そうなところだなあ」 ⚓content_type=の追加部分が落ちないよう修正 PR: Fix `content_type=` to not discard extra part by kamipo · Pull Request #37017 · rails/rails PR: Support extra stuff in the Content-Type header via Mime registration by tenderlove · Pull Request #36996 · rails/rails issue: Fragment content type issues in Rails 6.0 · Issue #36993 … Continue reading 週刊Railsウォッチ(20190902)Ruby 2.6.4セキュリティ修正リリース、スライド「All About Ruby in 2019」、Shrine gem 3.0に入る新機能ほか