Project

General

Profile

Actions

バグ #2206

open

複合コンポーネントの解体時にthreadに関するエラーが発生する。

Added by kurihara over 13 years ago. Updated almost 13 years ago.

Status:
新規
Priority:
通常
Assignee:
Start date:
08/08/2011
Due date:
% Done:

80%

Estimated time:

Description

複合コンポーネントを解体する処理の過程で、threadingのjoin()をコールした際に以下のエラーが発生する。
ただし、解体時に毎回発生するわけではなく不定期に発生する。

Exception RuntimeError: RuntimeError('cannot join current thread',) in <bound me
thod PeriodicExecutionContext.__del__ of <OpenRTM_aist.PeriodicExecutionContext.
PeriodicExecutionContext instance at 0x027A3508>> ignored

上記エラーは、Pythonのthreadingモジュール内のjoin()メソッドで、thread.get_ident()をコールし、
自身のスレッドのidと、join()の対象となっているスレッドのidが同じ場合に発生する。

Actions #1

Updated by kurihara over 13 years ago

  • % Done changed from 0 to 10

デバッグのため、thread.get_ident()を出力してみた.
複合コンポーネントの作成と解体を繰り返すと、解体時のthread.get_ident()の値は毎回同じであってが、
エラーが発生した際には異なる値となっていた。
なぜ、thread.get_ident()が異なる値を返すのかはわかっていない。

Actions #2

Updated by kurihara over 13 years ago

  • % Done changed from 10 to 80

Task.pyのデストラクタでtthreading.ThreadのisAlive()にてスレッドが生存しているか
確認を行い、生存している場合はそのスレッドに対してjoin()を行っているが、
スレッドが終了しているにも関わらずisAlive()がTrueとなる場合がある。

現在はjoin()を呼ばないようにしている。 r445

Actions

Also available in: Atom PDF