spring-projects / spring-projects/spring-session

Session scoped beans PreDestroy not called

Open
#1,256 8 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core status: feedback-provided type: bug
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Spring Session 2.1.1.RELEASE
This (https://spring.io/blog/2018/10/31/spring-session-bean-ga-released) mentions that it is now possible to use PreDestroy with Session scoped beans. I do not see the valueUnbound method being called when a Session is destroyed, and therefor PreDestroy is never called.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with Spring Session 2.1.1.RELEASE and inspect the session-destruction path where valueUnbound should be called. Verify that destroying a session invokes the callback and consequently triggers PreDestroy for session-scoped beans; the issue is complete when this behavior is covered and works as documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
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.