brutasse / graphite-cyanite

A plugin for using graphite-web with the cassandra-based Cyanite storage backend.
BSD 3-Clause "New" or "Revised" License
85 stars 21 forks source link

chunk requests to avoid overrunning URL length limits #4

Closed sgran closed 9 years ago

sgran commented 9 years ago

With many nodes in a series, we were running into jetty URL length limits, even when pushing the limit to ridiculous lengths like 32k. This patch chunks the request up into multiple requests, limiting the (configurable) length. It defaults to just under 8k, which should work with most web servers.

Signed-off-by: Stephen Gran stephen.gran@piksel.com

brutasse commented 9 years ago

Thanks for this! It'd be nice to have a small test for the chunk function once it's moved to a top-level function, just to be sure we don't introduce regressions in the future.

sgran commented 9 years ago

pushed now, let me know what you think

brutasse commented 9 years ago

Thanks for adding a test! Sorry to bother you again with this but chunk doesn't even have to be an instance method on the finder, does it?. It should be able to go completely top-level :)

sgran commented 9 years ago

oh, yes, it could do that. I didn't want to add a new top level export to the file to avoid leaking names, but it's up to you. Since it's only called from one method in the finder, I was fine with it being restricted to the finder.

brutasse commented 9 years ago

Yeah, I'd rather have an extra name than an instance method that doesn't use the instance :). Thanks!

brutasse commented 9 years ago

:shipit: