title: how to debug to find the code that is blocking the main thread
body: <p>I have a Rails app running version 6.1.1 and currently, we use Ruby 2.7.2</p>
  <p>While trying to upgrade to Ruby 3, I'm facing an interesting issue: some code apparently is blocking the main thread. When I try to boot the server or run the tests, the console stuck and I can't even stop the process, I have to <code>kill</code> it.</p>
  <p>I tracked it down to one gem called <code>valvat</code>, used to validate EU VAT numbers. I opened an issue on its Github repo but the maintainer couldn't reproduce even using the same <code>Gemfile.lock</code> I have, which lead me to believe that it might not be just the gem, gotta be something else in my code.</p>
  <p>This is what happens when I try to boot the server:</p>
  <pre><code>=&gt; Booting Puma
  =&gt; Rails 6.1.1 application starting in development
  =&gt; Run `bin/rails server --help` for more startup options
  ^C^C^C
  </code></pre>
  <p>as one can see, I can't even stop it, the thread is now hanging and I can't tell exactly by whom.</p>
  <p>I tried to run the specs with <code>-b -w</code> to see what I can see but got the same error: the thread hangs and the warnings I get from Ruby are just generic ones like <code>method already defined</code> or something like that.</p>
  <p>This is the last output from the console while running specs with <code>-b -w</code> before the thread hangs:</p>
  <pre><code>/Users/luiz/rails_dev/app/config/initializers/logging_rails.rb:18: warning: method redefined; discarding old tag_logger
  /Users/luiz/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/activejob-6.1.1/lib/active_job/logging.rb:19: warning: previous definition of tag_logger was here
  </code></pre>
  <p>thing is, I also get these warnings when I remove the gem and run this command though the specs run without issues then.</p>
  <p>Is there a way to track this down to whatever is causing the thread to hang?</p>