Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsq.Reader.disabled() no longer effective #117

Merged
merged 2 commits into from
Jul 28, 2015

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented May 12, 2015

Due to the "don't decrement rdy" change to nsqd behavior (nsqio/nsq#404), the current effect of disabled() returning True in nsq.Reader, of not sending any ready count (never calling _send_rdy()), fails to reduce the ready count to zero on the nsqd side.

@mreiferson mreiferson added the bug label Jan 6, 2015
@mreiferson
Copy link
Member

yep.

we probably want some periodic process that "watches" the return value of disabled() and sends RDY 0 when necessary and does the reverse if it becomes re-enabled...

@jehiah
Copy link
Member

jehiah commented May 12, 2015

finally taking a pass at this

@jehiah jehiah force-pushed the nsq_reader_117 branch 2 times, most recently from 1820e4a to c78113e Compare June 11, 2015 20:47
@jehiah
Copy link
Member

jehiah commented Jun 11, 2015

RFR @mreiferson (i'll confirm once i've validated this change set).

I successfully moved the travis builds for this over to container based infra =)

@@ -0,0 +1,25 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically test.sh doesn't have side effects like installing pkgs and such. I'm fine if you want to organize code into a script for travis, but let's not call it test.sh?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point. updating to travis_test.sh

@mreiferson
Copy link
Member

These changes look fine but it doesn't look like it completely addresses the issue in the OP - disabled() is still ineffective.

I'm assuming that in your actual reader you're subclassing disabled() and explicitly calling change_max_in_flight(0). Isn't that something that Reader should do for you so that we preserve the semantics of disabled() returning a bool to indicate state?

@jehiah
Copy link
Member

jehiah commented Jun 12, 2015

How i'm attempting to use this is here. which should expose enough to make disabling possible. I'm not 100% sure it'll work yet, but i think it will =)

I propose we add a check in disabled() such that it logs a warning if used against a newer nsqd where it's inefective. We can then remove it completely at the appropriate point when we drop support for older nsqd versions. Sound good?

@mreiferson
Copy link
Member

I propose we add a check in disabled() such that it logs a warning if used against a newer nsqd where it's inefective. We can then remove it completely at the appropriate point when we drop support for older nsqd versions. Sound good?

OK, sounds reasonable.

@ijl ijl mentioned this pull request Jun 12, 2015
@jehiah
Copy link
Member

jehiah commented Jul 28, 2015

@mreiferson previous comments addressed. Ready for 🔨 ?

"""
Called as part of RDY handling to identify whether this Reader has been disabled

This is useful to subclass and override to examine a file on disk or a key in cache
to identify if this reader should pause execution (during a deploy, etc.).

Note: deprecated. Use change_max_in_flight(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we ended up calling the method set_max_in_flight

remove usage of sudo to utilize travis container infrastructure for faster integration tests
@jehiah
Copy link
Member

jehiah commented Jul 28, 2015

comments fixed and 🔨'd

@mreiferson
Copy link
Member

LGTM

mreiferson added a commit that referenced this pull request Jul 28, 2015
nsq.Reader.disabled() no longer effective
@mreiferson mreiferson merged commit d6fb195 into nsqio:master Jul 28, 2015
@mreiferson mreiferson deleted the nsq_reader_117 branch July 28, 2015 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants