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

better 413 response handling #2418

Merged
merged 1 commit into from
Apr 22, 2016
Merged

better 413 response handling #2418

merged 1 commit into from
Apr 22, 2016

Conversation

gmmeyer
Copy link
Contributor

@gmmeyer gmmeyer commented Apr 13, 2016

When propjoe responds with a 413 error (payload too big), the agent used to retry the request. It shouldn't. The request shouldn't ever succeed.

This stops it from resubmitting the request. It logs a warning, saying what happened. It also adds a warning to the info page that a request was rejected.

if self.too_big_count:
if self.too_big_count > 1:
lines += [
"%d messages were rejected by the server as too big." % self.too_big_count
Copy link
Member

Choose a reason for hiding this comment

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

To stay consistent with the rest of the info page, I'd prefer this message to be displayed with the other stats on the transactions, i.e. something like:

Transactions rejected (too large): 15

right below Transactions flushed. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds good to me. Should it appear there even if none have been rejected?

@olivielpeau
Copy link
Member

@gmmeyer Cool stuff! Added in 2 comments

@@ -242,6 +242,7 @@ <h1 id="status-header">Agent info</h1>
<dt>Flush count</dt> <dd>{{ forwarder['flush_count'] }}</dd>
<dt>Queue size</dt> <dd>{{ forwarder['queue_size'] }} bytes</dd>
<dt>Queue length</dt> <dd>{{ forwarder['queue_length'] }}</dd>
<dt>Transactions Rejected (too large)</dt> <dd>{{forwarder['too_big_count']}}</dd>
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: could you add spaces between {{, }} and the var that's displayed (just for consistency)

Also, it's unrelated but while we're at it: could you add the Transactions received and Transactions flushed stats on this page too. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I can do all of that.

@olivielpeau olivielpeau self-assigned this Apr 14, 2016
@olivielpeau olivielpeau added this to the 5.8.0 milestone Apr 14, 2016
@gmmeyer gmmeyer force-pushed the 413-response branch 2 times, most recently from 7a070e7 to 8381f09 Compare April 18, 2016 17:13
@@ -757,7 +757,7 @@ class ForwarderStatus(AgentStatus):
NAME = 'Forwarder'

def __init__(self, queue_length=0, queue_size=0, flush_count=0, transactions_received=0,
transactions_flushed=0):
transactions_flushed=0, too_big_count=0):
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: any reason for changing the indentation here? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. I'll change it back. I think it was just what my autoindent did.

@olivielpeau
Copy link
Member

One last nitpcik, otherwise looks gtg!

@olivielpeau
Copy link
Member

👍

Feel free to squash your commits and then merge 🎉

@gmmeyer gmmeyer merged commit cf02339 into master Apr 22, 2016
@gmmeyer gmmeyer deleted the 413-response branch April 29, 2016 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants