Giter Club home page Giter Club logo

Comments (9)

mp911de avatar mp911de commented on May 28, 2024

I feared, this would happen sooner or later.

from lettuce.

kichik avatar kichik commented on May 28, 2024

My solution for this was to execute the subscription in a thread. It can be pushed on the Netty loop too I guess.

from lettuce.

mp911de avatar mp911de commented on May 28, 2024

I'm wondering whether it is a good idea to introduce a ConnectionOptions class for enabling/disabling reconnects and perhaps how reconnect errors should be handled. This does not solve the problem above but would give a more fine grained control to the user.

from lettuce.

kichik avatar kichik commented on May 28, 2024

That will be a good place to add that "ping before thinking the connection is alive" I asked for before. This way the SSL tunnel can be verified before being used.

from lettuce.

mp911de avatar mp911de commented on May 28, 2024

+1

from lettuce.

mp911de avatar mp911de commented on May 28, 2024

I think, removing synchronized from the dispatch() methods should solve the deadlock. The writeLock protects the reconnect sequence from other, interfering commands. Clients invoking commands while channelActive will simply wait until activated() is done.

from lettuce.

kichik avatar kichik commented on May 28, 2024

I think there is more reason for this synchronized. Another method using it is close() and we probably don't want anything writing while that is happening.

from lettuce.

mp911de avatar mp911de commented on May 28, 2024

synchronized on close() is important for that case. close() should be called rarely in comparison to other methods. The only race which could occur is when using MULTI and concurrent threads try to add commands to the MULTI. This is in any case a bad idea - with or without synchronized.

I took a look in the older version code. There was no inner lock and the method level synchronized on dispatch() was intended to prevent races. In certain constellations the commands received responses from earlier commands, therefore the inner lock came into place.

from lettuce.

mp911de avatar mp911de commented on May 28, 2024

Fixed with #59

from lettuce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.