This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Jim.Jewett, Mark.Shannon, gvanrossum, python-dev, rhettinger, vstinner
Date 2012-03-09.00:56:15
SpamBayes Score 2.5862096e-06
Marked as misclassified No
Message-id <CAMpsgwYHKRsr48zjMzbXzfO7dg8efmVvYw7hJEVU5poYeXmrRg@mail.gmail.com>
In-reply-to <1331254202.62.0.420547869889.issue14205@psf.upfronthosting.co.za>
Content
> Can you implement the counter without adding an extra field to the dict object?

Add a counter requires to change the prototype of the C lookup function:
PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash);

I don't know if it is a problem for ABI compatibility or extension
modules. I suppose that it is safer and simpler to not change it :-)

> I worry that we'll get the same objection we had when MAL proposed collision counting as a solution to the hash DoS attack.
>
> The numbers 0, 1 and infinity are special; all others are to be treated with skepticism.

Is it really useful to only retry once? Retrying once means that it
would work in most cases, but not in some corner cases. For example,
retrying once may hide the problem if you have only 1 client (1
thread), but you get the exception when you have more clients (more
threads).

Or do I misunderstand the problem?
History
Date User Action Args
2012-03-09 00:56:17vstinnersetrecipients: + vstinner, gvanrossum, rhettinger, Mark.Shannon, python-dev, Jim.Jewett
2012-03-09 00:56:16vstinnerlinkissue14205 messages
2012-03-09 00:56:15vstinnercreate