Project

General

Profile

Actions

Feature #13006

open

backtrace of thread killer

Added by akostadinov (Aleksandar Kostadinov) almost 8 years ago. Updated almost 8 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:78488]

Description

Hello, I am right now having difficulties to understand why one thread I have is dead. Seems been killed by something (rails/puma). But there is no way I can see to understand what and why did it.

That's why I'm proposing a new feature. This would be Thread#kill should record a backtrace at time of call and record it somewhere in the thread object so that later calling Thread#killer_trace would show what performed this call.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #6647: Exceptions raised in threads should be loggedClosedmatz (Yukihiro Matsumoto)Actions
Actions #1

Updated by shyouhei (Shyouhei Urabe) almost 8 years ago

  • Related to Feature #6647: Exceptions raised in threads should be logged added

Updated by shyouhei (Shyouhei Urabe) almost 8 years ago

  1. Pre-2.4 usage: Killed thread can still be joined. If you call join to a killed thread, that should raise an exception. Its backtrace contains the info you want.

  2. Starting from 2.4, in addition to the above, you can set Thread.report_on_exception = true (maybe at the very beginning of your code). This would automatically print backtraces for all killed threads immediately.

Actions

Also available in: Atom PDF

Like0
Like0Like0