question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comment stream dropping comments?

See original GitHub issue

Issue Description

A simple consumer like the below seems to not be processing all comments.

I observed a drop in total comment throughput with the praw stream sometime around december 2018 and it has never really recovered.

I have tested by manually making a number of comments and observing that some of them don’t get captured by the praw stream.

IO on the client side is not a limiting factor.

for comment in reddit.subreddit('all').stream.comments():
   do_something(comment)

System Information

  • PRAW Version: 6.0.0
  • Python Version: 3.7
  • Operating System:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:33 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
Pyprohlycommented, Mar 24, 2019

I think removing the before adjusting would be an acceptable fix for now, although know that everyone who’s not streaming from r/all is going to be slightly worse off, which makes me a little bit uncomfortable.

But it’s not like any other reddit api library does any sort of fancy before param adjusting either.

I’ll reintroduce before adjusting with a more optimal algorithm by the time I’m though with #1025. (My new streaming implementation already tries to detect the target listing’s activity and adjusts before accordingly, and in a future edit I’ll get it choose to keep using a None value for active listings like r/all.)

2reactions
nmtakecommented, Mar 19, 2019

I tried this script

import logging
import sys
import praw

logging.basicConfig(
        level=logging.DEBUG, stream=sys.stdout,
        format='%(asctime)s %(message)s')

reddit = praw.Reddit(...)
for comment in reddit.subreddit('all').stream.comments():
    print(comment.id)

And here is the result log. As we can see, there are many dropped comments as @bicubic pointed out, and some of them can be retrieved later via api/info:

>>> import praw
>>> reddit = praw.Reddit(...)
>>> dropped = ['t1_eivp01' + c for c in 'pquvxyz']
>>> for comment in reddit.info(dropped):
...     print(comment.id, comment.author)
...
eivp01p InnerRisk
eivp01q Skewered_Planets
eivp01u None
eivp01v Cirkah
eivp01x Chishikii
eivp01y sowaffled
eivp01z None

I too am guessing it’s a cache problem (rather than private subreddit or unapproved comment). As the second GET /comments request in the log suggests (it returns only 9 comments and too many holes), PRAW is requesting too fast?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twitch comment lag when posting a comment. : r/Twitch - Reddit
Whenever I post a comment in any chat it takes a while for my comment to show up. This thread is archived. New...
Read more >
3 Ways to Put Comments on Screen in a Livestream on ...
How to put comments on screen during your live stream … Whether you're using YouTube, Facebook or Twitch, here are 3 ways to...
Read more >
How to display comments in a Live Stream? 👀
View and manage comments from your YouTube, Facebook and Twitch streams in one place, and selectively display them on screen. Tutorial.
Read more >
How to Turn Off Student Comments in the Stream - Iorad
1. The first step is to open Google Classroom and click on Name of the Google Class to be altered. 2. Click on...
Read more >
SubredditStream — PRAW 7.6.1 documentation
for comment in reddit.subreddit("test").stream.comments(): print(comment) ... some high-volume streams, especially the r/all stream, may drop some ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found