Commit Graph

7708 Commits

Author SHA1 Message Date
Nelson Pecora
cdfe26096f add omitscript arg to oembed endpoint 2016-07-18 09:44:06 -07:00
Brian Simpson
af0525815a Subreddit._by_name: Use set rather than add when populating cache
We cache a sentinal value for when the subreddit doesn't exist. Doing
an add won't overwrite that existing value when the subreddit is created.
2016-07-15 08:39:59 -07:00
zeantsoi
fcdbaa7147 Assign default value to az_selfserve_network_id 2016-07-13 14:51:02 -07:00
Brian Simpson
b513b26656 CMemcache: Remove size validators
The validators were extraneous because they were raising a custom
exception when attempting to write a too-large value, but on its
own memcached will give an error (pylibmc gives ServerError).
2016-07-13 12:16:25 -07:00
Brian Simpson
65892eb799 Use multiple clients for mcrouter
Instead of using a pool with a single client, use a pool of
`num_mc_clients` clients. This prevents exhausting the pool in
concurrent setups, such as the default local install of reddit.
2016-07-12 14:02:08 -07:00
Brian Simpson
662751d01d Thing: Remove record_lookup
This was used to gather information about our use of lookups with and
without data attributes. Now we always load data attributes, and lookup
rates exist in graphite at "stats.cache.thingcache.{classname}" and
"stats.cache.thingcache.stale.{classname}".
2016-07-11 14:03:00 -07:00
Brian Simpson
f499585491 RedditControllerTestCase: Don't patch nonexistent g.cache 2016-07-11 13:19:03 -07:00
Brian Simpson
920b668760 TransitionalCache: Remove mention of g.cache 2016-07-11 13:19:03 -07:00
Brian Simpson
a384ebd654 Remove g.cache
It has been replaced by g.gencache (mcrouter) and other pools
2016-07-11 13:19:03 -07:00
Brian Simpson
8fbc42d45c cache: Update old test to use g.gencache instead of g.cache
These tests should probably be deleted or moved.
2016-07-11 13:19:03 -07:00
Brian Simpson
1c2a07a9e2 Thing: All subclasses must set the _cache attribute 2016-07-11 13:18:58 -07:00
Brian Simpson
a61823ae01 emr_traffic: Don't check existing cluster's bootstrap actions and steps
This was generally overkill and we should just assume that any cluster with
the correct name is compatible. Doing the extra checks was running into
AWS ratelimiting.
2016-07-11 13:18:44 -07:00
Chad Birch
ae2f0afede Approval checkmark: show full UTC datetime
This replaces the relative/fuzzy timestamp ("8 hours ago", etc.) when
hovering over an approval checkmark with the full UTC timestamp, which
is generally more useful info and can be more easily compared with
things like the time the post was made.
2016-07-11 12:29:55 -06:00
Chad Birch
0ac24dd560 Fix empty locale errors in format_number/percent
If our format_number() and format_percent() wrappers (around the babel
functions) aren't passed a locale argument, they will use c.locale. But
in some cases, c.locale will return an empty string, which will then be
used when calling the babel functions. The locale-parsing in babel is
unable to handle an empty string, and will throw an exception.

This commit changes these wrappers slightly so that if c.locale is also
empty, the wrappers will instead call the babel functions without a
locale argument, which will cause it to default to the LC_NUMERIC
environment variable.
2016-07-11 12:29:50 -06:00
Chad Birch
40dd0c2a6d /r/friends: Filter out posts by deleted/spam users
Deleted users are automatically removed from friends lists 90 days after
the account is deleted, but until that happens it's possible that their
posts will still show up in /r/friends. This will only occur if the
viewer has fewer friends than the limit used to build /r/friends, since
that causes a shortcut case that just returns all of their friends. If
they have more friends than the limit, the functions like
get_recently_submitted_friend_ids() will already filter out deleted/spam
users, but the shortcut doesn't do any filtering.

This commit adds similar filtering into the keep_fn() for
ListingController and CommentsController, which will filter out any
remaining posts by deleted/spam users at display-time. This was
preferable to just removing the shortcut and having all users query
for friends, since that query is fairly slow.
2016-07-11 12:29:42 -06:00
Shawn Krisman
7edd1ec8cd Use s3 to read and store subreddit sitemaps. 2016-07-07 15:12:28 -07:00
Roger Ostrander
4b2a669d6f Controllers: Remove @vary_pagecache_on_experiments entries 2016-07-06 17:55:30 -07:00
Brian Simpson
d732efd1e1 Use stalecache for "all:rising" key 2016-07-06 15:33:12 -07:00
Brian Simpson
84153cabea rising: Change the "all" key to work with replicated mcrouter 2016-07-06 15:33:07 -07:00
Neil Williams
6dbe772e03 Remove the pagecache
With some experimentation, we've determined that it is not necessary for
the site to function these days. There's no noticeable effect on p90 or
p99 response times in the loggedout cache pool and several large traffic
events have occurred while the pagecache was off. By removing this
layer, we reduce complexity, remove a possible source of poisoning bugs,
and make it easier to do stuff like logged out A/B experiments.
2016-07-06 13:44:06 -07:00
Chris Slowe
ade2b9da96 Add missing cache-varying decorator on POST_register. 2016-07-06 13:43:57 -07:00
adam
b3935be6aa Make Oembed endpoint work with links. 2016-07-06 13:43:57 -07:00
Chris Slowe
36990c40f5 Allow for multiple signing errors, and propagate onto login_event.
Rather than having the validator issue the 403 on improper signing, this moves the handling into the controller and therefore allows signing errors to be logged as part of a failed login_event.

Additionally, some persistent time-related issues with android's v1 implementation needs debugging.  This disables the epoch check but will still persist the error and timing info on the login_event.
2016-07-06 09:35:38 -07:00
Jack Niu
47c792248d Return json instead of html for /api/v1/login 403 2016-07-06 09:26:20 -07:00
Brian Simpson
267a7fccf0 emr_helpers: Don't convert date string to datetime
The date strings should sort correctly and for some reason the format of the
date strings aren't consistent so they can't be reliably converted to
datetimes.
2016-07-05 16:01:28 -07:00
Brian Simpson
f748f1423d LocalizedSubreddits: Ignore memcache errors 2016-07-05 13:42:11 -07:00
Brian Simpson
3ce8385af3 geoip: Ignore memcache errors 2016-07-05 13:42:11 -07:00
Brian Simpson
75cbbd02bb sgm: Optionally ignore errors on set 2016-07-05 13:42:06 -07:00
Brian Simpson
7bd786c09f Subreddit._by_name: Ignore errors on populating the cache 2016-07-05 13:41:45 -07:00
Brian Simpson
9ede0e7795 Import sgm from its own module, not from r2.lib.cache 2016-07-05 13:39:39 -07:00
Lev Alexandrovich Neiman
8c97bf4f24 Rethrow exception in exponential_retrier without sacrificing stack trace 2016-07-05 12:47:21 -07:00
Lev Alexandrovich Neiman
9282b47553 Add fetch_things_with_retry and exponential_retrier to utils 2016-07-05 12:46:59 -07:00
Kevin O'Connor
74033fc9dd Allow employees to distinguish messages. 2016-06-30 12:49:07 -07:00
Chad Birch
e355b0da5f Remove remaining links to /about/team page 2016-06-22 15:33:31 -06:00
Brian Simpson
28332d6430 Query: move caching to g.gencache and make key human readable 2016-06-21 13:58:37 -07:00
Brian Simpson
f46f38b229 CachedResults: implement get_query_iden() to not rely on Query._iden() 2016-06-21 13:57:34 -07:00
Brian Simpson
cff9be0969 MultiQuery: Remove caching
This wasn't used. The implementation might have run into problems with
overly long cache keys because it used a concatenation of the cache keys
of all the sub queries. If we really want to get some caching here the
sub queries should have read_cache/write_cache set.
2016-06-21 13:42:42 -07:00
J. Smith
4e7029bdbe Make mod removal message clear what user was removed
Specify the user that was removed in the subject line (instead of `You've been removed...`, it's `{user} has been removed...`) and start the message body with `{user}: You have been been removed...` (instead of just `You have been removed`).
2016-06-21 09:27:52 -07:00
Brian Simpson
387becd9e4 LocalizedSubreddits: Use g.gencache 2016-06-20 16:20:13 -07:00
Joshua Uziel
805a9a4b79 Onboarding: Featured subreddits API endpoint
Endpoint for retrieving subreddits to make new
users aware of without actually subscribing
them while doing the onboarding process.

The list of featured subreddits will be managed
separately from the default ones.

For testing purposes, we add a subreddit to show
up via the inject_test_data script.
2016-06-20 16:19:37 -07:00
Brian Simpson
c94ea00fd2 Subreddit._by_name: Use g.gencache 2016-06-20 16:07:03 -07:00
Brian Simpson
18fb269f1b rising: Use g.gencache 2016-06-20 16:06:53 -07:00
Brian Simpson
753039574e promote: Use g.gencache 2016-06-20 16:06:53 -07:00
Brian Simpson
004895b8ef geoip: Use g.gencache 2016-06-20 16:06:49 -07:00
Brian Simpson
7e0a7678da voting: Use g.gencache for queued votes 2016-06-20 16:06:42 -07:00
Brian Simpson
260268df5b captcha: Store solutions in g.gencache 2016-06-20 16:06:37 -07:00
Brian Simpson
6f78328c5d VOneTimePassword: Use g.gencache to check for code reuse 2016-06-20 16:06:30 -07:00
Brian Simpson
cf73f43adc api: Use g.gencache for storing otp secret 2016-06-20 16:06:30 -07:00
Brian Simpson
e81a93cba4 Add g.gencache for moving keys to mcrouter but still in the g.cache pool 2016-06-20 16:06:24 -07:00
Chris Slowe
1a452edf81 Re-allow announcements ("stickies") to apply to any type of link. 2016-06-20 15:56:16 -07:00