Skip to content

Conversation

@Hronom
Copy link
Contributor

@Hronom Hronom commented Jan 12, 2019

Fix bug when embedded mongo stopped and closed before all beans that relies on MongoDB stuff not closed.
During Spring context closing process beans can send requests to the mongo, but since daemonProcess by default is true - this enables shutdown hook:

		if (runtimeConfig.isDaemonProcess()) {
			ProcessControl.addShutdownHook(new JobKiller());
			registeredJobKiller = true;
		}

in tests this shutdown hook is called before all dependent beans is closed.

Code for shutdown hook here:

/de/flapdoodle/embed/de.flapdoodle.embed.process/2.0.5/de.flapdoodle.embed.process-2.0.5-sources.jar!/de/flapdoodle/embed/process/runtime/Executable.java:58

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 14, 2019
@wilkinsona wilkinsona changed the title Fix stopping of embedded mongo before spring context closed Embedded Mongo may be shut down while being used during application context close processing Feb 11, 2019
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 11, 2019
@wilkinsona wilkinsona added this to the 2.1.x milestone Feb 11, 2019
@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.1.3 Feb 11, 2019
@wilkinsona
Copy link
Member

Thanks very much for making your first contribution to Spring Boot, @Hronom. I've merged the proposed changes into 2.1.x and forwards into master. I also added a test in a separate commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants