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

Limit requeues #82

Merged
merged 4 commits into from Sep 26, 2016
Merged

Limit requeues #82

merged 4 commits into from Sep 26, 2016

Conversation

svenfuchs
Copy link
Contributor

@svenfuchs svenfuchs commented Sep 15, 2016

This is a draft.

This errors the job after 50 resets and 6 hours after the first reset ("requeue").

/cc @henrikhodne wdyt, any thoughts?

Copy link
Contributor

@sarahhodne sarahhodne left a comment

Choose a reason for hiding this comment

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

The logic mostly looks right to me, although I'm not super-familiar with the hub codebase anymore. I just have one question about the new helper method to add a log message to the logs, see in-line comment.

if aggregated_at
update_column(:content, [content, msg].join("\n"))
else
Part.create!(log_id: id, content: msg, final: true)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@svenfuchs
Copy link
Contributor Author

Tested this on staging with reduced limits for testing. It errored the job, and made the PUT request to travis-logs:

2016-09-22T19:47:18.900593+00:00 heroku[router]: at=info method=PUT path="/logs/513355" host=travis-logs-staging.herokuapp.com request_id=2fc60658-28af-4519-8170-caf598303c2c fwd="184.73.32.240" dyno=web.1 connect=0ms service=14ms status=204 bytes=124

I guess bytes=124 means the request body was 124 bytes long, and matches the length of the body I have PUT.

However, it didn't set the request body to log.content for some reason:

irb(main):008:0> Job.find(513355).log
> #<Log id: 464479, job_id: 513355, content: "", created_at: "2016-09-22 14:33:32", updated_at: "2016-09-22 19:47:18", aggregated_at: "2016-09-22 19:47:18", archiving: false, ar
hived_at: nil, archive_verified: nil, purged_at: nil, removed_by: nil, removed_at: nil>
rb(main):009:0> Job.find(513355).log.parts
> #<ActiveRecord::Associations::CollectionProxy []>

end

def update_log
logs.update(id, LOGS[:resets_support])

This comment was marked as spam.

This comment was marked as spam.

@svenfuchs
Copy link
Contributor Author

svenfuchs commented Sep 23, 2016

@svenfuchs svenfuchs changed the title Limit restarts Limit requeues Sep 26, 2016
@svenfuchs svenfuchs merged commit ff6de3a into master Sep 26, 2016
@svenfuchs svenfuchs deleted the sf-limit-restarts branch September 26, 2016 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants