Skip to content

Update flush mode related Spring Session configuration properties #17278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented Jun 20, 2019

As of Spring Session Corn-M3 support for configuring flush mode for reactive Redis sessions is deprecated due to removal of immediate mode support.

See spring-projects/spring-session#1441.

PR also contains upgrade to Corn snapshots - this would be nice to have on Boot side as we'll have a few configuration refinements for the upcoming M3 release. I'll provide PRs for Boot side as those happen in Spring Session.

@vpavic vpavic force-pushed the improve-session-support branch from a4d4fe5 to 4da9ec9 Compare June 20, 2019 13:25
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 20, 2019
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 20, 2019
@philwebb philwebb added this to the 2.2.x milestone Jun 20, 2019
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. If the property is specific to servlet-based deployment, perhaps we should indicate that it has no effect for reactive-based apps or something?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jun 21, 2019
@vpavic
Copy link
Contributor Author

vpavic commented Jun 21, 2019

Thanks for the feedback. If you have a way to indicate that this property doesn't have effect on reactive session store, that would be nice to have.

Note that we have the same situation from the very beginning with spring.session.redis.cleanup-cron that is used in imperative session store but not reactive counterpart.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 21, 2019
@snicoll
Copy link
Member

snicoll commented Jun 21, 2019

If you have a way to indicate that this property doesn't have effect on reactive session store, that would be nice to have.

There is nothing of the sort but perhaps the description of the key should state that? Flagging for team attention to see what the rest of the team thinks.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Jun 21, 2019
@wilkinsona
Copy link
Member

I wonder if we should create a separate group for Servlet-specific properties? Something like spring.session.redis.servlet perhaps? Or, if we think other stores are likely to have Servlet-specific configuration, it could be spring.session.servlet.redis.

@snicoll
Copy link
Member

snicoll commented Jun 21, 2019

I like that. @vpavic can you please help us figure this out? It really depends how many properties/store are affected.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jun 21, 2019
@vpavic
Copy link
Contributor Author

vpavic commented Jun 21, 2019

A case could be made for both grouping by stack or by data store first, as some properties will naturally reflect the underlying data store, while others will reflect the stack. The flush mode is something that will be limited to imperative i.e. Servlet implementations.

Personally I like the stack first, data store second (spring.session.servlet.redis) as it feels more natural and more aligned with other places (e.g. spring.thymeleaf.). Also:

  • there already are some spring.session.servlet. prefixed properties - filter-order and filter-dispatcher-types
  • IIRC spring.session.timeout was introduced solely for reactive support as there's no direct natural counterpart to server.servlet.session.timeout

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 21, 2019
@philwebb philwebb added for: team-attention An issue we'd like other members of the team to review and removed for: team-attention An issue we'd like other members of the team to review labels Jun 26, 2019
@vpavic vpavic force-pushed the improve-session-support branch from 4da9ec9 to b9bd5db Compare July 1, 2019 21:38
@vpavic
Copy link
Contributor Author

vpavic commented Jul 1, 2019

I've added a commit to this PR that handles deprecation of RedisFlushMode and HazelcastFlushMode in favor of new, common, FlushMode enum (see spring-projects/spring-session#1465).

It would be nice to get the first commit to master (upgrade to snapshots) as I'm planning to do more changes on Spring Session's config infrastructure and follow them up with PRs against Spring Boot.

Perhaps it would be good to hold off any major restructuring of properties until that effort is completed.

@vpavic vpavic changed the title Disable flush mode property mapping for reactive Redis session Update flush mode related Spring Session configuration properties Jul 2, 2019
@wilkinsona
Copy link
Member

It would be nice to get the first commit to master (upgrade to snapshots)

I think we need more than just the first commit. An upgrade to snapshots alone results in some test failures:

[ERROR] Failures: 
[ERROR]   ReactiveSessionAutoConfigurationRedisTests.defaultConfig:51->lambda$validateSpringSessionUsesRedis$0:78 
Expecting
  <org.springframework.session.data.redis.ReactiveRedisOperationsSessionRepository@38389b00>
to have a property or a field named <"redisFlushMode">
[ERROR]   ReactiveSessionAutoConfigurationRedisTests.defaultConfigWithUniqueStoreImplementation:59->lambda$validateSpringSessionUsesRedis$0:78 
Expecting
  <org.springframework.session.data.redis.ReactiveRedisOperationsSessionRepository@7c77bc86>
to have a property or a field named <"redisFlushMode">
[ERROR]   ReactiveSessionAutoConfigurationRedisTests.redisSessionStoreWithCustomizations:69->lambda$validateSpringSessionUsesRedis$0:78 
Expecting
  <org.springframework.session.data.redis.ReactiveRedisOperationsSessionRepository@7b02ef87>
to have a property or a field named <"redisFlushMode">
[ERROR]   SessionAutoConfigurationHazelcastTests.customFlushMode:84->lambda$customFlushMode$1:87 
Expecting
  <org.springframework.session.hazelcast.HazelcastSessionRepository@13b9f811>
to have a property or a field named <"hazelcastFlushMode">
[ERROR]   SessionAutoConfigurationRedisTests.defaultConfig:67->lambda$validateSpringSessionUsesRedis$0:124 
Expecting
  <org.springframework.session.data.redis.RedisOperationsSessionRepository@ff696a1>
to have a property or a field named <"redisFlushMode">
[ERROR]   SessionAutoConfigurationRedisTests.defaultConfigWithUniqueStoreImplementation:78->lambda$validateSpringSessionUsesRedis$0:124 
Expecting
  <org.springframework.session.data.redis.RedisOperationsSessionRepository@50bdf4d2>
to have a property or a field named <"redisFlushMode">
[ERROR]   SessionAutoConfigurationRedisTests.redisSessionStoreWithCustomizations:88->lambda$validateSpringSessionUsesRedis$0:124 
Expecting
  <org.springframework.session.data.redis.RedisOperationsSessionRepository@32d855a4>
to have a property or a field named <"redisFlushMode">

What's the smallest set of changes that we need to move onto snapshots and avoid deprecation warnings please, @vpavic? Is it all three of the commits proposed here?

@vpavic
Copy link
Contributor Author

vpavic commented Jul 2, 2019

Ah, yes - sorry @wilkinsona for the misleading comments. Since Spring Boot's tests use reflection to verify the state of configured that will fail since internally some member names have changed. I'll restructure commits on this PR shortly so that each commit is properly buildable.

@vpavic
Copy link
Contributor Author

vpavic commented Jul 2, 2019

Actually, scratch that - since tests rely on reflection rather than public API (changes there are backwards compatible) it's difficult to split these 3 commit and get individual as stable states.

Either way, I'd prefer to get this in early and do the restructuring of properties later on. We're still in milestone phase so it shouldn't be an issue.

@wilkinsona
Copy link
Member

Sounds good to me. I'll squash these three and get them into master.

@wilkinsona wilkinsona closed this in 4f47b39 Jul 2, 2019
@vpavic vpavic deleted the improve-session-support branch July 2, 2019 09:49
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.0.M5 Jul 2, 2019
@wilkinsona wilkinsona removed the status: feedback-provided Feedback has been provided label Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants