Commit Graph

7911 Commits

Author SHA1 Message Date
Brian Simpson
e4ebb6df4a comment_tree: Eliminate some duplication in calculating scores 2016-11-14 14:48:29 -08:00
Brian Simpson
1f5be6b3a6 _get_qa_comment_scores: Take cid_tree as input
Previously it wasn't clear that the CommentTree would be looked up and
that there might be some consistency concerns.
2016-11-14 14:48:29 -08:00
Brian Simpson
12d5f73a51 comment_tree: Move write_comment_scores to its own function 2016-11-14 14:48:22 -08:00
Brian Simpson
f90ab4aa71 write_comment_orders: Add counters to track writes vs. noops
This will let us get a sense of how much work is actually done. I'm looking
at splitting the CommentOrderer update out into a separate queue and need
to understand how many writes actually happen.
2016-11-14 14:48:16 -08:00
Brian Simpson
b22711866c add_comments: Remove warning about writing scores first
This warning was no longer true--any missing scores are automatically
calculated and updated.

We actually have the opposite issue--the CommentTree must be updated
before writing scores because the QA score reads it.
2016-11-14 14:48:11 -08:00
Brian Simpson
c7d0f5b607 voting: Don't update comment scores on automatic initial vote
Score updates are processed through commentstree_q. When a new comment
is created an automatic initial vote (by the comment's author) is created.
This results in two messages in commentstree_q: one from the vote and one
from queries.new_comments. Don't create the message from the vote because it
is redundant. This will let us reduce the volume of messages in commentstree_q
which is currently very high.
2016-11-14 14:48:04 -08:00
Brian Simpson
9544da4905 feature: Fix race condition when live_config is updated
Instead of checking _featurestate_cache for a key's existence and then
retrieving it, just get it and then check for a miss. Doing the two step
process can result in a KeyError if _featurestate_cache is cleared between
the existence check and the retrieval.
2016-11-14 14:47:53 -08:00
Brian Simpson
4d7a7f5568 db_manager: Don't setup a connection for some dbs on startup
"email", "authorize", "hc", and "traffic" databases aren't used that
often and maybe we can reduce the number of connections to pg-05 by
waiting to establish a connection until it's actually needed.
2016-11-14 14:47:24 -08:00
Brian Simpson
da00f3eefb voting: Don't use fastlane vote processor
The fastlane processor was meant to handle votes on both Links and Comments,
but it can't do that easily anymore now that the vote processing has been
split. It's not a big deal now because Link vote processing is much faster
now that the query updating has been separated and sharded. The Comment vote
consumer/queue was getting some benefit from the fastlane and it can be
resurrected if we run into problems.
2016-11-03 16:04:07 -07:00
Chris Slowe
d48c387b7c Don't error on unicode in the votestream.
Change the error from a 500 to a line in the error log with more info about what/why it failed.
This seems to be the result of someone's crappy votebot.
2016-11-03 16:04:04 -07:00
Katie Atkinson
44521216b2 Add ability for all oauth tokens to be invalidated on password change
Add 'revoke_sessions' method to 'POST_update_password'
2016-11-01 12:02:51 -07:00
Brian Simpson
58da74cb9a Remove warning about disabled imgur domain listings 2016-10-26 12:03:45 -07:00
Brian Simpson
09bb39cfc1 Process domain listing for imgur.com 2016-10-26 12:00:05 -07:00
Brian Simpson
7f3113f476 link votes: Use a queue to update links by domain queries
The queue can be sharded by domain to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same domain (e.g. votes for different
links to a single domain).
2016-10-26 11:59:54 -07:00
Brian Simpson
5ebee0959f link votes: Use a queue to update links by subreddit queries
The queue can be sharded by subreddit id to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same subreddit (e.g. votes for different
links submitted to a single subreddit).
2016-10-26 11:59:49 -07:00
Brian Simpson
1e5fa7670f link votes: Use a queue to update links by author queries
The queue can be sharded by author id to minimize lock contention
and the consumer will batch updates to the same links (e.g. several
votes for the same link) and to the same author (e.g. votes for different
links submitted by a single author).
2016-10-26 11:57:17 -07:00
Brian Simpson
67d71d6329 Unshard vote_link_q 2016-10-26 11:55:00 -07:00
Brian Simpson
aef5f483ae voting: Use separate methods for updating cached queries
This makes the individual tasks of the consumer more readable.
2016-10-26 11:54:55 -07:00
Brian Simpson
d0d6d24e1a voting: Only need to lock when updating user's liked links 2016-10-26 11:54:49 -07:00
Brian Simpson
c226567d0d Inline vote processor work 2016-10-26 11:54:42 -07:00
Brian Simpson
371398ed51 Use different consumers for Link and Comment votes 2016-10-26 11:54:32 -07:00
Brian Simpson
c4f3db6ef0 Add timings in Link vote processor
This will help us understand which parts are most time consuming
and whether we can benefit by breaking up the updates into multiple
queues.
2016-10-26 11:54:12 -07:00
Brian Simpson
fd9e8b4e41 Split processing for Link votes and Comment votes 2016-10-26 11:54:01 -07:00
Brian Simpson
22de659e23 link.py: Move cast_vote import to within method
This gets around some circular import issues and is simpler than changing
the imports in voting.py.
2016-10-26 11:29:36 -07:00
Brian Simpson
329b3c1c8e LocalCache.simple_get_multi: Use exception handling to get keys
Doing the 2 step process of:
1. check for existence of key
2. get key

introduces a race condition if the key is deleted between the two steps.
2016-10-25 11:25:36 -07:00
Brian Simpson
2fdddb69e4 raven: Specify all application code path prefixes
The raven client inspects the traceback and attempts to figure out which
parts belong to the app and which belong to external libraries. It uses
a whitelist of paths to identify application code. Previously we had been
using the list of repository names, but that was incorrect because the
plugin "liveupdate" is actually called "reddit_liveupdate" in the traceback.
The whitelist was also incomplete because it didn't account for scripts run with
paster run which can have a path like /opt/something/script.py.
2016-10-19 16:34:43 -07:00
Brian Simpson
1d0dda280a compute_time_listings: Report exceptions to Sentry 2016-10-19 16:34:22 -07:00
Brian Simpson
3328493ef5 RunCommand: Report exceptions with RavenErrorReporter 2016-10-19 16:33:24 -07:00
Brian Simpson
48930b80c5 RavenErrorReporter: Don't install_sys_hook
This creates a sys.excepthook handler that reports any exceptions
to Sentry. This results in double reporting errors when in script
mode because the exception is re-raised and caught by that handler.
2016-10-19 16:33:24 -07:00
Brian Simpson
6c7c5df58e RavenErrorReporter: handle exceptions in script mode 2016-10-19 16:33:19 -07:00
Prashant Singh
40625dcc07 Add page-based experiment support
We can conduct experiments that impact how pages are rendered across
users, bucketing pages according to the fullname, so that search engines
will crawl and index the same experimental content that users see. We
support subreddit listings pages, comments pages, and comment permalink
pages. We use the link fullname for both comments pages and comment
permalink pages, so that they are bucketed together.
2016-10-19 15:52:38 -07:00
Prashant Singh
098d047e8a Tell crawlers not to index comment permalink pages
We don't want to spend crawl budget or rank on what are essentially
duplicate pages. In case we have inbound links to these pages, we don't
want the robots.txt to prevent crawlers from accessing them.
2016-10-19 15:20:22 -07:00
William Ting
94a70830be Add automatic search engine integration.
This adds the required metadata and files to support automatic search engine
additions to Chrome / Chromium.
2016-10-18 10:15:20 -07:00
Daniel Ellis
d5992d6a30 Remove memcached deletion from hardcache cleanup. 2016-10-12 11:06:29 -07:00
Dan
8b31ebc99b Remove hardcache cache. 2016-10-12 10:00:01 -07:00
Matt Lee
da54902795 reddit.js: Don't submit disabled forms in post_form 2016-10-07 17:48:13 -04:00
Matt Lee
8fb3e9106d errors.js: Add r.errors.create method
Makes creating errors consistent with the formatting of API errors on
the client side easier.
2016-10-07 17:48:13 -04:00
Matt Lee
45b7989556 mixins.less: Add moz and ms prefixes to animation 2016-10-07 17:48:12 -04:00
Matt Lee
f61ba21bc0 POST_fetch_title: Send title in json response data 2016-10-07 17:48:12 -04:00
Matt Lee
d003c3a4fc JS: Add actions.js 2016-10-07 17:48:12 -04:00
Matt Lee
1d467eed70 Add callback to r.analytics.sendEvent 2016-10-07 17:48:12 -04:00
Matt Lee
381d2a0ca3 Events.js - use callback if supplied 2016-10-07 17:48:12 -04:00
Matt Lee
8cb8cd4ca6 Wrap js config in scriptsafe_dumps 2016-10-07 17:48:12 -04:00
Matt Lee
ad69953293 r.syncedSessionStorage: Get values from e.originalEvent
The jQuery event doesn't expose the storage key or newValue attributes.
2016-10-07 17:48:12 -04:00
Matt Lee
e946fa3b58 Use jQuery to bind storage event listener
I suspect that IE8 is throwing some errors here because of this.
2016-10-07 17:48:12 -04:00
Matt Lee
107cf63841 fixup: Prevent error while instantiating r.syncedSessionStorage 2016-10-07 17:48:12 -04:00
Matt Lee
5db40de34f Fix expando events on previews getting wrong provider 2016-10-07 17:48:12 -04:00
Matt Lee
c23a188774 Analytics: Allow defining events outside of analytics.js
Conflicts:
	r2/r2/public/static/js/analytics.js
2016-10-07 17:48:11 -04:00
Matt Lee
ad08159fc8 JS: Add r.syncedSessionStorage 2016-10-07 17:48:11 -04:00
Matt Lee
01ce8b5810 Expando: Use sprites for new expando icons 2016-10-07 17:48:11 -04:00