Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Remove _paginate_issue()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marc-Antoine Ruel  
View profile  
 More options Jan 30, 12:45 pm
From: Marc-Antoine Ruel <mar...@chromium.org>
Date: Mon, 30 Jan 2012 12:45:18 -0500
Local: Mon, Jan 30 2012 12:45 pm
Subject: Remove _paginate_issue()

Hi

I feel support ?offset=<number> should be deleted. We got harvested
recently and the fact that offset can be used took a lot of datastore
processing power from our instance.

So my take:

   1. Add to def search() the option to sort in decreasing timestamp. Let's
   say it's "order=decreasing" here for simplicity.
   2. Fix /search UI to be consistent.
   3. Links "Open Issues", "Closed Issues" and "All Issues" should be
   updated to be redirected to /search?<relevant_query>.
   4. def index() should redirect to /search?closed=3&order=decreasing.
   Determine: Handle old query args or don't bother?
   5. def all() should redirect to
   /search?closed=1&order=decreasing. Determine: Handle old query args or
   don't bother?
   6. def _paginate_issue() can then be deleted. Yay!

Any opinion?

M-A


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guido van Rossum  
View profile  
 More options Jan 30, 1:12 pm
From: Guido van Rossum <gu...@python.org>
Date: Mon, 30 Jan 2012 10:12:38 -0800
Local: Mon, Jan 30 2012 1:12 pm
Subject: Re: Remove _paginate_issue()
I feel dense -- I do not see how you would resolve viewing the rest of
the issues if the first page doesn't hold them all.

FWIW if you want to kill offset shouldn't you also kill limit? It can
also be abused.

--
--Guido van Rossum (python.org/~guido)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
anatoly techtonik  
View profile  
 More options Jan 30, 1:26 pm
From: anatoly techtonik <techto...@gmail.com>
Date: Mon, 30 Jan 2012 20:26:07 +0200
Local: Mon, Jan 30 2012 1:26 pm
Subject: Re: Remove _paginate_issue()

On Mon, Jan 30, 2012 at 8:45 PM, Marc-Antoine Ruel <mar...@chromium.org>wrote:

> Hi

> I feel support ?offset=<number> should be deleted. We got harvested
> recently and the fact that offset can be used took a lot of datastore
> processing power from our instance.

Is there any way to guard AppEngine apps from such attacks?

So my take:

>    1. Add to def search() the option to sort in decreasing timestamp.
>    Let's say it's "order=decreasing" here for simplicity.
>    2. Fix /search UI to be consistent.
>    3. Links "Open Issues", "Closed Issues" and "All Issues" should be
>    updated to be redirected to /search?<relevant_query>.
>    4. def index() should redirect to /search?closed=3&order=decreasing.
>    Determine: Handle old query args or don't bother?
>    5. def all() should redirect to
>    /search?closed=1&order=decreasing. Determine: Handle old query args or
>    don't bother?
>    6. def _paginate_issue() can then be deleted. Yay!

> Any opinion?

I'd start with porting to Python 2.7
http://code.google.com/p/rietveld/issues/detail?id=348
then to Django 1.3,
then make `closed` parameter intuitive
http://code.google.com/p/rietveld/issues/detail?id=298
then try to make further enhancements.

In general making all() and index() to be redirects to unified and
paginated search output seems ok, but it will also double amount of
requests unless all menu links are replaced with /search URLs.
--
anatoly t.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc-Antoine Ruel  
View profile  
 More options Jan 30, 2:18 pm
From: Marc-Antoine Ruel <mar...@chromium.org>
Date: Mon, 30 Jan 2012 14:18:11 -0500
Local: Mon, Jan 30 2012 2:18 pm
Subject: Re: Remove _paginate_issue()

Le 30 janvier 2012 13:12, Guido van Rossum <gu...@python.org> a écrit :

> I feel dense -- I do not see how you would resolve viewing the rest of
> the issues if the first page doesn't hold them all.

> FWIW if you want to kill offset shouldn't you also kill limit? It can
> also be abused.

limit can't be abused in the sense that it's limited to 1000. For some odd
reason, it seems that offset > 1000 isn't refused right away and instead
caused the instance to spin for 60 seconds, on every request. The guy was
eventually using offset over 100000. The online log dashboard isn't useful
to know what happened earlier, I can only see last few hours.

The main difference between _paginate_issue() and
_paginate_issues_with_cursor() is that a cursor is much more efficient and
coherent than an offset.

Le 30 janvier 2012 13:26, anatoly techtonik <techto...@gmail.com> a écrit :

> Is there any way to guard AppEngine apps from such attacks?

Yes, dos.yaml. I used it but it's manual.

There could be a middleware to throttle some kinds of heavy weight requests
from a single IP (let's ignore ddos here) but even that is lower priority
to me.

Le 30 janvier 2012 13:26, anatoly techtonik <techto...@gmail.com> a écrit :

> I'd start with porting to Python 2.7
> http://code.google.com/p/rietveld/issues/detail?id=348
> then to Django 1.3,
> then make `closed` parameter intuitive
> http://code.google.com/p/rietveld/issues/detail?id=298
> then try to make further enhancements.

> In general making all() and index() to be redirects to unified and
> paginated search output seems ok, but it will also double amount of
> requests unless all menu links are replaced with /search URLs.

Replacing the links was specified as step 3.
The rest is priorization.

M-A


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guido van Rossum  
View profile  
 More options Jan 30, 2:25 pm
From: Guido van Rossum <gu...@python.org>
Date: Mon, 30 Jan 2012 11:25:39 -0800
Local: Mon, Jan 30 2012 2:25 pm
Subject: Re: Remove _paginate_issue()

On Mon, Jan 30, 2012 at 11:18 AM, Marc-Antoine Ruel <mar...@chromium.org> wrote:
> Le 30 janvier 2012 13:12, Guido van Rossum <gu...@python.org> a écrit :

>> I feel dense -- I do not see how you would resolve viewing the rest of
>> the issues if the first page doesn't hold them all.

>> FWIW if you want to kill offset shouldn't you also kill limit? It can
>> also be abused.

> limit can't be abused in the sense that it's limited to 1000. For some odd
> reason, it seems that offset > 1000 isn't refused right away and instead
> caused the instance to spin for 60 seconds, on every request. The guy was
> eventually using offset over 100000. The online log dashboard isn't useful
> to know what happened earlier, I can only see last few hours.

I guess he was just following all links in the UI?

We could replace the next/prev links with links based on cursors, then
there would be no cost to skip to the desired point in the query.

> The main difference between _paginate_issue() and
> _paginate_issues_with_cursor() is that a cursor is much more efficient and
> coherent than an offset.

Duh, so we already use cursors? Forget what I said then. :-)

--
--Guido van Rossum (python.org/~guido)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc-Antoine Ruel  
View profile  
 More options Jan 30, 2:32 pm
From: Marc-Antoine Ruel <mar...@chromium.org>
Date: Mon, 30 Jan 2012 14:32:05 -0500
Local: Mon, Jan 30 2012 2:32 pm
Subject: Re: Remove _paginate_issue()

Le 30 janvier 2012 14:25, Guido van Rossum <gu...@python.org> a écrit :

/all uses offsets, /search uses cursors. This results in mostly similar
code. Hence my original proposition.

M-A


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guido van Rossum  
View profile  
 More options Jan 30, 2:34 pm
From: Guido van Rossum <gu...@python.org>
Date: Mon, 30 Jan 2012 11:34:33 -0800
Local: Mon, Jan 30 2012 2:34 pm
Subject: Re: Remove _paginate_issue()
+1, then. :-)

--
--Guido van Rossum (python.org/~guido)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
anatoly techtonik  
View profile  
 More options Jan 31, 3:13 am
From: anatoly techtonik <techto...@gmail.com>
Date: Tue, 31 Jan 2012 11:13:59 +0300
Local: Tues, Jan 31 2012 3:13 am
Subject: Re: Remove _paginate_issue()

On Mon, Jan 30, 2012 at 10:18 PM, Marc-Antoine Ruel <mar...@chromium.org>wrote:

You didn't mention cursors in the first place, so that's ok for me. =) If I
understand correctly, cursor just doesn't allow to go to 15th page
directly, is that right?

> Le 30 janvier 2012 13:26, anatoly techtonik <techto...@gmail.com> a écrit
> :

>  Is there any way to guard AppEngine apps from such attacks?

> Yes, dos.yaml. I used it but it's manual.

> There could be a middleware to throttle some kinds of heavy weight
> requests from a single IP (let's ignore ddos here) but even that is lower
> priority to me.

I wonder if such middleware should be provided by AppEngine to protect
customers from attacks that directly empty their bank accounts?

--
anatoly t.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc-Antoine Ruel  
View profile  
 More options Jan 31, 10:03 am
From: Marc-Antoine Ruel <mar...@chromium.org>
Date: Tue, 31 Jan 2012 10:03:10 -0500
Local: Tues, Jan 31 2012 10:03 am
Subject: Re: Remove _paginate_issue()

Le 31 janvier 2012 03:13, anatoly techtonik <techto...@gmail.com> a écrit :

> On Mon, Jan 30, 2012 at 10:18 PM, Marc-Antoine Ruel <mar...@chromium.org>wrote:

>> The main difference between _paginate_issue() and
>> _paginate_issues_with_cursor() is that a cursor is much more efficient and
>> coherent than an offset.

> You didn't mention cursors in the first place, so that's ok for me. =) If
> I understand correctly, cursor just doesn't allow to go to 15th page
> directly, is that right?

Exactly, you have to follow the pages one at a time and can't skip to a
random offset. It's a minor annoyance for greater good.

Sorry I somehow took cursor usage as "common knowledge". :)

Anyway, I was just touching water, I'll take a look how messy it is to
complete.

I don't think it's AE's duty to do that. But I wouldn't be surprised if
someone had already written something like that for django. Something that
piggies back on appstats and detect 10 minutes average sudden increase or
send IM on sudden error increases.

M-A


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »