Skip to content

terminate Sashiko early when HEAD commit hash not found#284

Closed
TheSven73 wants to merge 1 commit into
sashiko-dev:mainfrom
TheSven73:no-head-hash-crash-early
Closed

terminate Sashiko early when HEAD commit hash not found#284
TheSven73 wants to merge 1 commit into
sashiko-dev:mainfrom
TheSven73:no-head-hash-crash-early

Conversation

@TheSven73

@TheSven73 TheSven73 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

We expect to be always able to retrieve the HEAD commit hash. Reports from the field suggest that this is not always the case. We do not yet understand the root cause.

Failure to retrieve the commit hash results in deadlocks, which prevent patches from completing review.

Take a leaf out of The Pragmatic Programmer's "Dead Software tells no lies" and terminate early when the unexpected happens.

Pros:

  • failing reviews are retried after Sashiko restarts (instead of deadlocked)
  • the termination log allows us to learn why the unexpected happened

Cons:

  • if not intermittent, failing reviews may be retried forever

See #248

We expect to be always able to retrieve the HEAD commit hash. Reports
from the field suggest that this is not always the case. We do not
yet understand the root cause.

Failure to retrieve the commit hash results in deadlocks, which prevent
patches from completing review.

Take a leaf out of The Pragmatic Programmer's "Dead Software tells no
lies" and terminate early when the unexpected happens.

Pros:
- failing reviews are retried after Sashiko restarts
    (instead of deadlocked)
- the termination log allows us to learn why the unexpected happened

Cons:
- if not intermittent, failing reviews may be retried forever

See sashiko-dev#248

Signed-off-by: Sven Van Asbroeck <TheSven73@googlemail.com>
@TheSven73 TheSven73 force-pushed the no-head-hash-crash-early branch from 6d3cca3 to 4803878 Compare June 19, 2026 13:19
@TheSven73 TheSven73 changed the title crash Sashiko early when HEAD commit hash not found terminate Sashiko early when HEAD commit hash not found Jun 19, 2026
@derekbarbosa

derekbarbosa commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @TheSven73 !

Do you think that this may be complementary to #228?

Some of the changes there attempt to resolve a proper baseline/head when one cannot be found. I see here the emphasis of this PR is to "fail better" when a commit hash cannot be resolved.

I would welcome a few eyes on that, if you have some spare time :)

@TheSven73

Copy link
Copy Markdown
Contributor Author

Hi @derekbarbosa

From what I understand, it's not quite the same thing. The issue here is something that should always work (a git repo always has a HEAD) which fails, the unexpected untested failure path percolates, and eventually threatens the integrity of the running Sashiko instance. It struggles on, wounded :)

Whereas your #228 appear to deal with improvements to DESIGN_BASELINE_DETECTION.md and/or DESIGN_ROBUST_BASELINE.md

Do you think that sounds right? Let me know, thanks.

@derekbarbosa

Copy link
Copy Markdown
Collaborator

Hi @derekbarbosa

From what I understand, it's not quite the same thing. The issue here is something that should always work (a git repo always has a HEAD) which fails, the unexpected untested failure path percolates, and eventually threatens the integrity of the running Sashiko instance. It struggles on, wounded :)
Whereas your #228 appear to deal with improvements to DESIGN_BASELINE_DETECTION.md and/or DESIGN_ROBUST_BASELINE.md

Do you think that sounds right? Let me know, thanks.

Ah, thanks for the clarification. I hadn't had a chance to look at the code when following the parent discussion from Arnaldo -- so sorry for offloading my "wet compute" to you 😄

@rgushchin

Copy link
Copy Markdown
Member

I don't think panic'ing the main binary is justified here. Instead the review should be terminated gracefully with patch(set) getting into the "failed to apply" state. Panicing the main binary will be really bad for the user experience.

@TheSven73 TheSven73 closed this Jun 23, 2026
@TheSven73 TheSven73 deleted the no-head-hash-crash-early branch June 23, 2026 00:45
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.

3 participants