Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Flaky diff behavior #1083

Closed
Closed
@vmarkovtsev

Description

@vmarkovtsev

diffmatchpatch.DiffMatchPatch has a member named DiffTimeout, which is time.Second by default. If the diff calculation takes more than that limit, it is aborted and the current, half-baked results are returned immediately. This is really, really evil for all the users. Imagine that you are running some actions which involve go-git diffs under heavy load, e.g. in gitbase, or you run them on a retarded machine, such as TravisCI. You are going to have flaky behavior, which is extremely hard to debug.

I have recently hit this problem in Hercules actually (src-d/hercules#234 (comment)), and it was quite painful.

I suggest to at least make the timeout limit configurable and documented in diff.go, at maximum set it to a safely big value, like one hour.

cc @ajnavarro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions