apache / apache/grails-core

Grails application reachable before fully deployed

Open
#12,717 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

### Expected Behavior

The Grails application should not allow users to make HTTP requests before the application is fully deployed.

### Actual Behaviour

The application accepts and actually processes HTTP requests before 'com.valsight.BootStrap#init' has finished executing.

This is especially problematic in relation to the "org.grails.plugins:database-migration" plugin, because the app processes HTTP requests, before the migrations are done.

Here is an example project that adds a delay to 'com.valsight.BootStrap#init' you can use to easily create HTTP requests before the app is deployed.
[app-accessible-too-early-bug-report-27092022.zip](https://github.com/grails/grails-core/files/9664308/app-accessible-too-early-bug-report-27092022.zip)

### Steps To Reproduce

1. In any environment
2. Start the application (use the attached project to make it easier)
3. fire an HTTP request to the application while 'com.valsight.BootStrap#init' is executing
4. the actual error: the HTTP request is fully processed before 'com.valsight.BootStrap#init' is finished

### Environment Information

Operating system: Ubuntu 22.04
Java version:
`openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-8u342-b07-0ubuntu1~22.04-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
`

### Example Application

_No response_

### Version

5.2.4

Contributor guide

Open the contributing guide

Research direction

Start with the attached example application and the com.valsight.BootStrap#init entry point, adding the demonstrated startup delay to reproduce the race. Trace when HTTP request processing becomes available relative to init completion and verify that requests are not fully processed until deployment finishes, including with the database-migration plugin.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.