Skip to content
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

Synchronization/cross thread visibility of variables #94

Closed
mp911de opened this issue Jul 1, 2015 · 1 comment
Closed

Synchronization/cross thread visibility of variables #94

mp911de opened this issue Jul 1, 2015 · 1 comment
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Jul 1, 2015

Some variables within CommandHandler and RedisChannelHandler are accessed multi-threaded:

  • RedisChannelHandler.active
  • RedisChannelHandler.closed
  • CommandHandler.closed
  • CommandHandler.connected
  • CommandHandler.channel

In certain constellations, updates are not visible to other threads and this leads to broken states (connection.close() but active=true or closed=false).

Goal: Prevent races/visibility issues

@mp911de mp911de changed the title Synchronization/cross thread visibility Synchronization/cross thread visibility of variables Jul 1, 2015
mp911de added a commit that referenced this issue Jul 3, 2015
Unify connection state tracking into one field (lifecycleState) to prevent race conditions when reading the state. Use synchronized blocks to adopt JMM semantics and address thread visibility issues
@mp911de
Copy link
Collaborator Author

mp911de commented Jul 4, 2015

Needs merge to 4.0 branch

@mp911de mp911de added this to the Lettuce 3.3 milestone Jul 4, 2015
mp911de added a commit that referenced this issue Jul 6, 2015
Synchronization/cross thread visibility of variables #94

- Unify connection state tracking into one field (lifecycleState) to prevent race conditions when reading the state. Use synchronized blocks to adopt JMM semantics and address thread visibility issues
@mp911de mp911de closed this as completed Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant