File tree Expand file tree Collapse file tree
iplass-web/src/main/java/org/iplass/mtp/impl/web Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ private int getHttpStatus(WarmupStatus status) {
136136 * ウォームアップタスク実行
137137 * <p>
138138 * サーブレットの初期化処理で非同期実行されるウォームアップ処理のエントリポイントです。
139+ * エントリポイントでは Throwable で例外をキャッチし、例外をキャッチした場合はステータスを失敗に変更します。
139140 * </p>
140141 */
141142 protected static class WarmupTaskExecutor implements Callable <Void > {
@@ -171,9 +172,23 @@ public Void call() throws Exception {
171172
172173 return null ;
173174
174- } catch (Exception e ) {
175- logger .error ("Warmup failed." , e );
176- throw e ;
175+ } catch (Throwable t ) {
176+ logger .error ("Warmup failed." , t );
177+
178+ try {
179+ ServiceRegistry .getRegistry ()
180+ .getService (WarmupService .class )
181+ .changeStatus (WarmupStatus .FAILED );
182+
183+ } catch (Exception e ) {
184+ logger .error ("Failed to change warmup status to FAILED." , e );
185+ }
186+
187+ switch (t ) {
188+ case Exception e -> throw e ;
189+ case Error e -> throw e ;
190+ default -> throw new RuntimeException (t );
191+ }
177192 }
178193 }
179194
You can’t perform that action at this time.
0 commit comments