Forums: Open Discussion (Thread #21864)

【バッチFW】 コレクタにおけるRuntimeException発生 (2009-02-27 13:33 by tminato #42206)

jp.terasoluna.fw.batch.core.JobManager#processCollect()の延長上で、
コレクタのcollect()がRuntimeExceptionをスローして、
ワーカーに何もデータが渡らない場合があります。

それにも関わらず、
jp.terasoluna.fw.batch.core.JobManager#work()で
managerQueue.waitForAllWorkers()を実行して
ワーカーから処理が戻ってくるのを待機しているため、
ジョブが終了しません。

これを改善して、ジョブが終了するようにしていただくことはできませんでしょうか?

# 2.0.0.4 / 2.0.1.0ともに同じ問題があります。

Reply to #42206×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-02-27 14:09 by kuramotoki #42208)

当方の環境で確認したところ、問題なくジョブは異常終了にて停止します。

処理の流れとしましては、

1.JobManager#processCollectで例外が発生し例外ハンドラで処理された際に
ジョブ状態が異常終了に変更される。
2.ワーカー側でキューからデータをtakeするQueueProcessor#processにて、
StandardWorkQueue#takeメソッドの部分でデータを取得するが、
その中でジョブ状態をチェックし異常終了であればQueueingExceptionをthrowする。
3.QueueProcessor#processでQueueingExceptionをキャッチし、
ジョブ状態を確認し、コレクタ側で異常が発生しているならばreturnする

となります。

ジョブが止まらないのであればジョブ状態が変更されていないと思われるので
・例外ハンドラはジョブ状態を異常終了にしているか
・jobManagerやコレクタ等を拡張しているならば、正しくジョブ状態を変更しているか
などを確認していただけますでしょうか。

以上です。
Reply to #42206

Reply to #42208×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-02-27 16:45 by tminato #42210)

ご指摘の通り、「例外ハンドラでジョブ状態を異常終了にする」ことで、解決しました。
迅速な回答をありがとうございました。
Reply to #42208

Reply to #42210×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-05-26 10:04 by tminato2009 #43997)

> ・例外ハンドラはジョブ状態を異常終了にしているか

上記説明があるドキュメントの所在を教えていただけないでしょうか。
Reply to #42208

Reply to #43997×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-05-27 11:06 by ahn #44016)

例外ハンドラについては機能説明書(TERASOLUNA Batch Framework for Java 機能説明書.pdf)の「BH-01 例外ハンドリング機能」をご参照ください。
ジョブの終了に関連する内容は「BE-05 処理結果ハンドリング機能」をご参照ください。その他「補足資料: モデル別の中断・強制終了時の動作」の内容も終了に関する内容ですので参考になると思います。
Reply to #43997

Reply to #44016×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-06-03 19:19 by tminato2009 #44185)

「例外ハンドラはジョブ状態を異常終了にしなければならない」ということが明記されているドキュメントの所在を知りたいのです。
Reply to #44016

Reply to #44185×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-06-03 19:42 by ahn #44188)

「例外ハンドラはジョブ状態を異常終了にしなければならない」というルールはありません。
「処理内容(仕様)にしたがってジョブの状態を決められる」のが例外例外ハンドラの役割です。
例外ハンドラ関連の説明は#44016に記載されている内容をご参照下さい。
Reply to #44185

Reply to #44188×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-06-04 11:39 by Anonymous #44198)

コレクタが例外をスローした場合、例外ハンドラでジョブ状態を異常終了にしなければ、
ジョブが終了しないという問題があります。

このような事象について、ドキュメント記載があるかどうかを確認しています。
Reply to #44188

Reply to #44198×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 【バッチFW】 コレクタにおけるRuntimeException発生 (2009-06-04 13:10 by ahn #44199)

TERASOLUNA Batch Framework for Java 機能説明書.pdf)の
「BD-02 対象データ取得機能」ページ「6/17」
「対象データ取得でエラーが発生した場合」に
例外(エラー)が発生した場合の処理について記述されております。
Reply to #44198

Reply to #44199×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login