Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Spring Security slow startup

オープン
#16,461 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
groovy, java, spring, spring-boot

調査の方向性

Start by profiling application-context initialization with Spring Security enabled and disabled, focusing on bean pre-instantiation, EventListenerMethodProcessor, AnnotationsScanner, and class loading. Compare JFR data and bean timing around doWithSpring(), then identify the exact blocking call or bean factory phase responsible for the roughly 8.4-second pause. Done means the responsible initialization work is identified and a reproducible improvement or explanation is established.

索引モデルが issue の本文から書いたものです。

説明

Expected Behavior

Spring Security adds a long pause during application startup

Environment

  • Grails: 8.0.0-RC1
  • Spring Boot: 4.1.1
  • Spring Framework: 7.0.9
  • Java: 25.0.4.1
  • Profile: development

Observed behavior

Startup pauses for several seconds after these messages:

Configuring Spring Security Core ...

... finished configuring Spring Security Core

Configuring Spring Security LDAP ...

... finished configuring Spring Security LDAP

In a baseline run, the first datasource initialization log appeared about 8.4 seconds after the application startup log. Spring Boot reported a total startup time of 11.849 seconds.

Disabling all Spring Security removes the pause. Disabling LDAP alone does not, suggesting that the delay is associated with Spring Security Core or work it triggers later in Spring context initialization.

Investigation

The plugin configuration itself does not appear to account for the delay.

  • doWithSpring() took about 76 ms for Spring Security Core.
  • doWithSpring() took less than 1 ms for LDAP.

A temporary bean timing probe recorded 587 beans. The slowest intervals were mostly Grails and framework initialization:

  • servletContainer: about 2.45 s
  • Grails URL mapping and Hibernate metadata bean chain: about 2.3–2.4 s
  • grailsSimpAnnotationMethodMessageHandler: about 0.91 s
  • groovyPagesTemplateEngine: about 0.55 s
  • gspTagLibraryLookup: about 0.54 s

These bean intervals include dependency creation and overlap, so they must not be added together.

Individual Spring Security beans were comparatively fast:

  • Authentication filter: about 31 ms
  • LDAP authentication provider: about 16 ms
  • LDAP authenticator: about 8 ms
  • LDAP context source: about 6 ms

No LDAP network wait was observed during startup.

JFR evidence showed activity around:

  • Spring bean pre-instantiation
  • EventListenerMethodProcessor / AnnotationsScanner
  • Class loading
  • Grails/Hibernate metadata initialization

This suggests that the pause occurs during broader application-context initialization rather than in the plugin's printed configuration methods, but the exact blocking call has not yet been identified.

Configuration comparison

The controller annotations were replaced with a centralized InterceptUrlMap containing equivalent role rules.

This did not materially improve startup.

Before the change
  • Total startup time: 11.849 s
  • Application startup → first datasource initialization: about 8.405 s
With the final URL-map configuration
  • Total startup time: 11.812 s
  • Application startup → first datasource initialization: about 8.349 s

Other post-change runs ranged from 11.997 s to 12.366 s total.

The small difference is within run-to-run variation. The pause remains at about 8.4 seconds.

Current assessment

Spring Security is correlated with the delay, but no individual Spring Security bean or Core/LDAP configuration method accounts for several seconds.

The evidence points to initialization work triggered or made eager when Spring Security is enabled.

Further profiling is needed to identify the exact call or bean factory phase responsible.

Actual Behaviour

No response

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

Grails 8.0.0-RC1

主要言語
Groovy
スター
2.9k
フォーク
976
平均マージ
21時間 14分
マージ済み PR(30日)
174

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/grails-core のほかの issue

apache/grails-core の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。