vertx-zookeeper icon indicating copy to clipboard operation
vertx-zookeeper copied to clipboard

Using map names with forward slashes (`/` character) returns empty childData

Open doctorpangloss opened this issue 4 years ago • 2 comments

Version

vertx-hazelcast:3.9.1

Context

https://github.com/vert-x3/vertx-zookeeper/blob/fdd14dcc2855091df15fbb11bc265fbd425fd71d/src/main/java/io/vertx/spi/cluster/zookeeper/impl/ZKAsyncMultiMap.java#L259

Observe that if the user supplies a map key that contains forward slashes, empty data will be returned from Zookeeper due to this split.

Do you have a reproducer?

Simply create a map named Test/map.

doctorpangloss avatar Jul 07 '20 02:07 doctorpangloss

Emm..

We can replace forward slash which in input with empty string from vertx-zookeeper, but can not replace it from other input, such as zkCli.sh I will make PR to fix it.

On Jul 7, 2020, at 10:30 AM, Benjamin Berman [email protected] wrote:

Version

vertx-hazelcast:3.9.1

Context

https://github.com/vert-x3/vertx-zookeeper/blob/fdd14dcc2855091df15fbb11bc265fbd425fd71d/src/main/java/io/vertx/spi/cluster/zookeeper/impl/ZKAsyncMultiMap.java#L259 https://github.com/vert-x3/vertx-zookeeper/blob/fdd14dcc2855091df15fbb11bc265fbd425fd71d/src/main/java/io/vertx/spi/cluster/zookeeper/impl/ZKAsyncMultiMap.java#L259 Observe that if the user supplies a map key that contains forward slashes, empty data will be returned from Zookeeper due to this split.

Do you have a reproducer?

Simply create a map named Test/map.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-zookeeper/issues/100, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCWE4ZNB35VFR65B5FK6TR2KCC3ANCNFSM4OSLDPKQ.

stream-iori avatar Jul 12 '20 01:07 stream-iori

One possibility is to throw an IllegalArgumentException that is implementation specific, so that at least people don't get an extremely cryptic crash (it right now fails to deserialize an empty object)

doctorpangloss avatar Jul 12 '20 03:07 doctorpangloss