hi Sean.

Sean Cribbs wrote:
Alexander,

The solution is to send multiple instances of the same header, which is valid HTTP.  Split 
your  long headers (I'm guessing "Link"?) into < 8K chunks.
thanks for pointing out that solution.

i decided against it, here's why:

the client lib delegates a associative array(dict) to pycurl or
httplib(the latter as a fallback if the libcurl-bindings are not available).

as these libs take the dict's as input, there's no way to put in the
same key twice. maybe there's funny parameters, a quick search didn't
yield something.

also the client doesn't know about the server's length limits, so it can
only assume a value that's probably the most server's default.

last point is simple: don't build all that links ;)

i just started with designing data to stored in this fashion, so i'll
just set the links from many objects to one objects rather than many
links from one object(blowing up that Link header field).

cheers,

alexander


Sean Cribbs <[email protected]>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/

On Apr 25, 2010, at 6:28 AM, alexander krohn wrote:

hi.

sorry for replying myself ;)

the header hits the 8k size mark, that causes the 400.

is there a way to configure the max header length for the rest api's http 
server? like apache's LimitRequestFieldsize?

also there's a bug in the python client lib, the links are qouted but not unquoted. this 
leads to "growing" and wrong tag names.

patch for __init__.py:

1650c1650,1653
<                                 link = RiakLink(matches.group(2), 
matches.group(3), matches.group(4))
---
                                bucket = urllib.unquote_plus(matches.group(2))
                                key = urllib.unquote_plus(matches.group(3))
                                tag = urllib.unquote_plus(matches.group(4))
                                link = RiakLink(bucket, key, tag)

cheers,

alexander

alexander krohn wrote:
hi.
(i already posted this yesterday in irc, mailing-list subscribe was pending)
i'm using python to insert several items to riak. the code i'm using[1] 
receives an http 400 exactly while inserting the 238th link to an object.
the response tells no additional errors, also the erlang-log doesn't show 
anything.
something wrong on my side or bug?
can anyone reproduce this 400?
thanks in advance.
cheers,
alexander
[1] used code:
import riak
client = riak.RiakClient('127.0.0.1',
                        8098,
                        transport_class=riak.RiakHttpTransport)
print "client alive: ", client.is_alive()
bucket = client.bucket('t1')
a = bucket.new('a', (1, 2, 3))
for i in range(1000):
   x = bucket.new('x_%i' % i, i)
   x.store()
   print "stored", i + 1, "items"
   a.add_link(x, 'dings').store()
   print "stored", i + 1, "links"
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com




_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to