profile
viewpoint
Marcos Nils marcosnils Wildlife studios Buenos Aires https://www.twitter.com/marcosnils Ops Head @ ▲ | Former Infra lead @ MELI | Docker Captain 🐋⛵ | Play with docker | Golang and OSS ❤️| Jedis Maintainer. 🍔🍷⚽️⛵️🏋️🏂 and some 🕹️ 🇦🇷

marcosnils/cmt 113

Container migration tool

marcosnils/bin 102

Effortless binary manager

mantika/whaleprint 73

Manage DAB as service blueprints for docker swarm mode

collabnix/kubezilla 40

Building a largest Kubernetes Community Cluster

hypriot/rpi-noip 15

rpi-noip is a docker image of the official no-ip Dynamic DNS Update client

mantika/go-ratelimiter 7

Rate limiting middleware for negroni

mantika/govipe 6

A super small golang library that launches the default EDITOR with the given input and returns the modified content as output

marcosnils/AceevoBooks 1

GWT 2.x Tutorial with MongoDB, Morphia, RequestFactory, Activities and Places, Editors, Cell Table/List, Twitter Bootstrap

push eventredis/jedis

M Sazzadul Hoque

commit sha 227fb41a40fc65068edf7bd8d6d07a6f3d4302c6

close Jedis objects

view details

push time in 10 hours

PR opened redis/jedis

Reviewers
Resolve connection leaking in tests and modify test codes WAIT FOR MORE REVIEWS

Resolve connection leaking in:

  • JedisSentinelPoolWithCompleteCredentialsTest
+97 -175

0 comment

11 changed files

pr created time in 13 hours

issue commentredis/jedis

xread with block=0 doesn't block

yeah, we are "suffering" from the same behaviour. after going back to use jedis (we used an own implementation of the streams when it was not available) - we noticed a spike in CPU usage when using xread, only to find this exact piece of code. as workaround, we did set the value to Long.MAX_VALUE.

awaizman1

comment created time in 15 hours

push eventredis/jedis

M Sazzadul Hoque

commit sha 1de2354bc1445aeb4b55b94e598d1c6e25e1b948

increase timeout between failover

view details

push time in 16 hours

push eventredis/jedis

M Sazzadul Hoque

commit sha f2397550a8dace0f94067757f9b703ba5798067c

Execution time can be 0

view details

push time in 18 hours

issue openedredis/jedis

Add support for clientUnblock command

Hi,

I couldn't find the clientUnblock command in jedis. This is very useful when working with streams blocking xread commands.

Is there a plan to add this command?

thanks.

created time in a day

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

         "Cannot open Redis connection due invalid URI. %s", uri.toString()));     } -    this.hostAndPort.set(new HostAndPort(uri.getHost(), uri.getPort()));-    this.connectionTimeout = connectionTimeout;-    this.soTimeout = soTimeout;+    this.jedisSocketFactory = new DefaultJedisSocketFactory(+        uri.getHost(), uri.getPort(), connectionTimeout, soTimeout,+        JedisURIHelper.isRedisSSLScheme(uri), sslSocketFactory,+        sslParameters, hostnameVerifier+    );     this.user = JedisURIHelper.getUser(uri);     this.password = JedisURIHelper.getPassword(uri);     this.database = JedisURIHelper.getDBIndex(uri);     this.clientName = clientName;-    this.ssl = JedisURIHelper.isRedisSSLScheme(uri);-    this.sslSocketFactory = sslSocketFactory;-    this.sslParameters = sslParameters;-    this.hostnameVerifier = hostnameVerifier;   }    public void setHostAndPort(final HostAndPort hostAndPort) {

Yup, I meant all not either (shouldn't have used / here :D), so something like:

JedisSocketFactory newFactory = jedisSocketFactory.get().clone();
newFactory.setHost(...);
newFactory.setPort(...);
jedisSocketFactory.set(newFactory);
mina-asham

comment created time in 2 days

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

         "Cannot open Redis connection due invalid URI. %s", uri.toString()));     } -    this.hostAndPort.set(new HostAndPort(uri.getHost(), uri.getPort()));-    this.connectionTimeout = connectionTimeout;-    this.soTimeout = soTimeout;+    this.jedisSocketFactory = new DefaultJedisSocketFactory(+        uri.getHost(), uri.getPort(), connectionTimeout, soTimeout,+        JedisURIHelper.isRedisSSLScheme(uri), sslSocketFactory,+        sslParameters, hostnameVerifier+    );     this.user = JedisURIHelper.getUser(uri);     this.password = JedisURIHelper.getPassword(uri);     this.database = JedisURIHelper.getDBIndex(uri);     this.clientName = clientName;-    this.ssl = JedisURIHelper.isRedisSSLScheme(uri);-    this.sslSocketFactory = sslSocketFactory;-    this.sslParameters = sslParameters;-    this.hostnameVerifier = hostnameVerifier;   }    public void setHostAndPort(final HostAndPort hostAndPort) {

Hmm, first one does seem like a prominent one if you have actually meant copy+update+reset.

mina-asham

comment created time in 2 days

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

         "Cannot open Redis connection due invalid URI. %s", uri.toString()));     } -    this.hostAndPort.set(new HostAndPort(uri.getHost(), uri.getPort()));-    this.connectionTimeout = connectionTimeout;-    this.soTimeout = soTimeout;+    this.jedisSocketFactory = new DefaultJedisSocketFactory(+        uri.getHost(), uri.getPort(), connectionTimeout, soTimeout,+        JedisURIHelper.isRedisSSLScheme(uri), sslSocketFactory,+        sslParameters, hostnameVerifier+    );     this.user = JedisURIHelper.getUser(uri);     this.password = JedisURIHelper.getPassword(uri);     this.database = JedisURIHelper.getDBIndex(uri);     this.clientName = clientName;-    this.ssl = JedisURIHelper.isRedisSSLScheme(uri);-    this.sslSocketFactory = sslSocketFactory;-    this.sslParameters = sslParameters;-    this.hostnameVerifier = hostnameVerifier;   }    public void setHostAndPort(final HostAndPort hostAndPort) {

That's a good point, but even if we add synchronized it would still be prone to some corner cases in the other methods since make/validate can still happen mid-updating the host/port.

I can think of a few solutions here (no particular ordering beside preference towards first one):

  • We put the jedis socket factory in an atomic reference, we make the setHostAndPort copy/update/reset the jedis socket factory
  • We put synchronized on all methods (overkill and I really think that's a bad option, but just listing)
  • We keep an instance of HostAndPort in an atomic reference and cross check/validate with that (but then we duplicate the state and make it a bit too complex)
  • The setHostAndPort method is only used in sentinel pool, we can mark the method as deprecated with a comment for removal in a future release, and change the sentinel bit to re-create the whole pool (although I don't know the sentinel code that well so maybe it's a bad idea)

What do you think?

mina-asham

comment created time in 2 days

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

 public JedisPool(final GenericObjectPoolConfig poolConfig, final URI uri,         sslParameters, hostnameVerifier));   } +  public JedisPool(final GenericObjectPoolConfig poolConfig, final JedisSocketFactory jedisSocketFactory,+      final String user, final String password, final int database, final String clientName) {+    super(poolConfig, new JedisFactory(jedisSocketFactory, user, password, database, clientName));+  }++  public JedisPool(final GenericObjectPoolConfig poolConfig, final JedisSocketFactory jedisSocketFactory) {+    super(poolConfig, new JedisFactory(jedisSocketFactory, null, null, Protocol.DEFAULT_DATABASE, null));+  }++  public JedisPool(final JedisSocketFactory jedisSocketFactory) {+    super(new GenericObjectPoolConfig(), new JedisFactory(jedisSocketFactory, null, null, Protocol.DEFAULT_DATABASE, null));+  }

Good point, will update.

mina-asham

comment created time in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

 public JedisPool(final GenericObjectPoolConfig poolConfig, final URI uri,         sslParameters, hostnameVerifier));   } +  public JedisPool(final GenericObjectPoolConfig poolConfig, final JedisSocketFactory jedisSocketFactory,+      final String user, final String password, final int database, final String clientName) {+    super(poolConfig, new JedisFactory(jedisSocketFactory, user, password, database, clientName));+  }++  public JedisPool(final GenericObjectPoolConfig poolConfig, final JedisSocketFactory jedisSocketFactory) {+    super(poolConfig, new JedisFactory(jedisSocketFactory, null, null, Protocol.DEFAULT_DATABASE, null));+  }++  public JedisPool(final JedisSocketFactory jedisSocketFactory) {+    super(new GenericObjectPoolConfig(), new JedisFactory(jedisSocketFactory, null, null, Protocol.DEFAULT_DATABASE, null));+  }

Use this instead of super.

mina-asham

comment created time in 2 days

Pull request review commentredis/jedis

Add support to the use of JedisSocketFactory using a pool

         "Cannot open Redis connection due invalid URI. %s", uri.toString()));     } -    this.hostAndPort.set(new HostAndPort(uri.getHost(), uri.getPort()));-    this.connectionTimeout = connectionTimeout;-    this.soTimeout = soTimeout;+    this.jedisSocketFactory = new DefaultJedisSocketFactory(+        uri.getHost(), uri.getPort(), connectionTimeout, soTimeout,+        JedisURIHelper.isRedisSSLScheme(uri), sslSocketFactory,+        sslParameters, hostnameVerifier+    );     this.user = JedisURIHelper.getUser(uri);     this.password = JedisURIHelper.getPassword(uri);     this.database = JedisURIHelper.getDBIndex(uri);     this.clientName = clientName;-    this.ssl = JedisURIHelper.isRedisSSLScheme(uri);-    this.sslSocketFactory = sslSocketFactory;-    this.sslParameters = sslParameters;-    this.hostnameVerifier = hostnameVerifier;   }    public void setHostAndPort(final HostAndPort hostAndPort) {

This should be synchronized for reliablity as there is no AtomicReference.

mina-asham

comment created time in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

fork khorevaa/bin

Effortless binary manager

fork in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

startedmarcosnils/bin

started time in 2 days

PR opened redis/jedis

Add support to the use of JedisSocketFactory using a pool
  • Support for JedisSocketFactory has already been added to the lowest level Jedis to support adding any custom socket factory (e.g. UDS), this propagates the support in the JedisPool too
+67 -5

0 comment

3 changed files

pr created time in 2 days

push eventredis/jedis

Guy Korland

commit sha 7938fc94d8f3baaaf2b1df869ce3961814252446

increase timeout between failover

view details

push time in 3 days

push eventredis/jedis

Guy Korland

commit sha 29e7405314587390e2230619633f944d5516ba41

Fix text verify cluster set before test

view details

push time in 3 days

pull request commentredis/jedis

Throw an exception when trying to read from a broken connection

what does it mean broken connection, what are the possibilities to broke a connection

mina-asham

comment created time in 3 days

PR opened redis/jedis

Add support for new multi-key commands: SMISMEMBER and ZMSCORE
  • Available since Redis 6.2 (future release at this point)
  • See: https://redis.io/commands/smismember
  • See: https://redis.io/commands/zmscore
+270 -1

0 comment

20 changed files

pr created time in 4 days

issue openedredis/jedis

About the performance of the transaction after the revision of jedis 3.0.0

Hello, I found that since jedis version 3.0.0 (precisely from PR #511), the way transactions are handled has changed.

From the perspective of command interaction:

before:

jedis multi command_1 comand_2 ... command_n ---> redis redis +OK +QUEUED +QUEUED ... +QUEUED ---> jedis jedis exec ---> redis redis +OK ---> jedis

now:

jedis multi ---> redis redis +OK ---> jedis jedis comand_1 comand_2 ... command_n ---> redis redis +QUEUED +QUEUED ... +QUEUED ----> jedis jedis exec ----> redis redis +OK ----> jedis

After preliminary testing, the performance comparison is as follows:

Total number of transactions executed: 100000 Number of commands in the transaction: 2 redis version: 4.0.6 Total time required (ms): Previous version: 3701 Current version: 8779

Test code:


public void test() {

    Jedis jedis = new Jedis("127.0.0.1", 6379);

    String key = "k1";

    Map<String, String> map = new HashMap<>();

    map.put("f1", "v1");

    map.put("f2", "v2");

    map.put("f3", "v3");

    long startTime = System.nanoTime();

    for (int i = 0; i < 100000; i++) {

      Transaction multi = jedis.multi();

      multi.hmset(key, map);

      multi.pexpire(key, 10000);

      multi.exec();

    }

    System.out.println("total time: " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime));

 }

In summary, the revised jedis is more worrying in terms of transaction execution performance (especially when the number of commands to be executed in a transaction is small). I wonder if you have any good way to solve it? Or if you already have an optimization method in this area, please tell me how to use it, thank you very much. :)

created time in 4 days

push eventplay-with-go/play-with-go

Paul Jolly

commit sha dc4c6564f61415f50d511498164fa1b61244d2c6

guides: use latest docker images for improved prompt (#333) This isn't perfect because we still have a hack whereby the upload of a file is faked as a command. We should make this a proper command (as a comment) in any case.

view details

Paul Jolly

commit sha 5f217f6d4eccc35b0637ff23fffd37a838ebb2d2

contributing: create a simple "guide" as a demo of how to do it!

view details

push time in 4 days

more