Bug#690192: python-zookeeper truncates paths with more than 255 characters.

2013-02-07 Thread James Page
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Paul

On 11/10/12 01:43, Paul Dwerryhouse wrote:
 There appears to be a problem with python-zookeeper's handling of
 nodes with that have a total path length that is greater than 255
 characters. It can be demonstrated with this simple test program,
 which creates a node with path length of 302 characters. The return
 value from zookeeper.create should be exactly the same, in this
 case, but instead, it is trucated at 255 characters:

Digging into the python source code reveals that the buffer used to
hold the path returned from zookeeper is only 256 bytes; the zookeeper
C code truncates the path to fit the buffer resulting in the shortened
return path.

I agree that this does appear to be odd behaviour - I'll dig a bit deeper.


- -- 
James Page
Ubuntu Core Developer
Debian Maintainer
james.p...@ubuntu.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBCAAGBQJRE5WyAAoJEL/srsug59jDPrUP/iGwJFNeU9lAIg5hfZW6Rtlx
b8U6nr4yb168SNB+dRJoBBtKO+dr9UqU0Rt2uGDa7aTKI6PT2zoKI4J3PgMpRwcH
s7f8mgF/k0f1SHF9N7drSl2ewMinkVf9BWD1GdG/1l2E8PFmsflsQsY5UQAdEaBQ
PfJuOlp6kfHCPEMCtaFCPghNE8Fbu+hQy49LeAzDTkKXzOkEW+QACtsP+ZCDEUxD
I0UlT0IW2HK+flNIaR4neS40e1ENJWBuZLqKM4S4M3VXMG3NQL3T3jx2CUtLLBg3
UokAuAD45pMcGSFtAVaCO3FB6gQHv6jEfg3kRTdGEltwrLIb9Wd8RobVQ396H5Nc
53kjbLRpW0b6Ys53eY6bQafS+KaEfv0ZztJyfiCkkrkmFb8rWfQ2IN80t69M7UpF
860XZVUYtTzSW264m1ZI6tT4mDZDltAFY412+oqKgHfP5RGBfSBe600K0L8Y9Q8O
sLdGCI0k0nkCpb2kki7zgNcR+pQCb+UMpBX4FMgArzoC90tKdrTkM6p99Q2PzBo4
RYQZLHxkHq/FjM/3QFg1mp0KM5d5Tp+VySXH04Q8UJvDfo6rDtL/gq5ROsTLrd/o
GJwhOUphWStSad98VPpZGe3vlL0XuJh/fcUJlv7lOYPFD50dd/FBQZnzAe3MsmzF
G2QcqkaeM80ARu5cyb9u
=E3sy
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#690192: python-zookeeper truncates paths with more than 255 characters.

2012-10-10 Thread Paul Dwerryhouse
Package: python-zookeeper
Version: 3.3.5+dfsg1-2
Severity: normal

There appears to be a problem with python-zookeeper's handling of nodes with
that have a total path length that is greater than 255 characters. It can
be demonstrated with this simple test program, which creates a node with
path length of 302 characters. The return value from zookeeper.create should
be exactly the same, in this case, but instead, it is trucated at 
255 characters:

==
#!/usr/bin/python 

import zookeeper

ZOO_OPEN_ACL_UNSAFE = {perms:0x1f, scheme:world, id :anyone}
path = / + x * 300 + X
servers=127.0.0.1:2181

zh = zookeeper.init(servers)
znode = zookeeper.create(zh,path, 'test', [ZOO_OPEN_ACL_UNSAFE], 0)

print path
print znode

zookeeper.delete(zh, znode)
==

# ./ztest.py
/X
/xx
Traceback (most recent call last):
  File ./ztest.py, line 20, in module
zookeeper.delete(zh, lockfile)
zookeeper.NoNodeException: no node

 
Checking in the Zookeeper cli confirms that the node is created successfully,
and it's only the name returned from zookeeper.create that is truncated.

I cannot find any information on what the maximum allowed path length is,
for Zookeeper, but this doesn't really matter, because if paths longer than
256 characters aren't allowed, then it should be throwing an exception at
create time.

I have also checked that it's not just the node-name length that is the 
problem - it's definitely the total length of the path.

Thanks,

Paul


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-zookeeper depends on:
ii  libc6 2.13-35
ii  libzookeeper-mt2  3.3.5+dfsg1-2
ii  python2.7.3~rc2-1
ii  python2.6 2.6.8-0.2
ii  python2.7 2.7.3~rc2-2.1

python-zookeeper recommends no packages.

python-zookeeper suggests no packages.

-- debconf-show failed


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org