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

jobs: tiny improvement to error handling #57307

Merged
merged 1 commit into from Dec 3, 2020

Conversation

jordanlewis
Copy link
Member

Closes #56999

Release note: None

@jordanlewis jordanlewis requested review from knz and a team December 1, 2020 17:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @knz)


pkg/jobs/adopt.go, line 312 at r1 (raw file):

					id, s.ID())
			default:
				return errors.AssertionFailedf("unexpected job status %s: %v", job)

Your format string expects two arguments here and you've only provided one. Did you mean statusString, job instead of only job?

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @knz)

Copy link
Member Author

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @knz and @postamar)


pkg/jobs/adopt.go, line 312 at r1 (raw file):

Previously, postamar (Marius Posta) wrote…

Your format string expects two arguments here and you've only provided one. Did you mean statusString, job instead of only job?

Quite right - fixed.

Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @knz)

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

:lgtm: with nit

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 2 stale) (waiting on @jordanlewis)


pkg/jobs/adopt.go, line 262 at r2 (raw file):

		// comment this out.
		// if errors.HasAssertionFailure(err) {
		// 	logcrash.ReportOrPanic(ctx, nil, err.Error())

Can you update this comment too?
(ditto the one in deprecated.go)

@jordanlewis
Copy link
Member Author

Hmm, I don't understand those comments. @lucy-zhang?

Copy link
Contributor

@thoszhang thoszhang left a comment

Choose a reason for hiding this comment

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

The introduction of the ReportOrPanic calls was originally so that we could have tests crash in contexts where we don't actually want to crash or return errors in production. I commented it out because it was causing test crashes in contexts where we actually wanted failures (IIRC). So if we don't want to call ReportOrPanic anymore, then none of the commented-out lines are relevant anymore and should just be removed.

Reviewed 1 of 2 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 2 stale) (waiting on @jordanlewis)

@jordanlewis
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Dec 3, 2020

Build succeeded:

@craig craig bot merged commit e51e04c into cockroachdb:master Dec 3, 2020
@jordanlewis jordanlewis deleted the adopt-err branch December 3, 2020 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jobs: stray log.ReportOrPanic in adopt.go
6 participants