Skip to content

Add timeout to Jupyter Diff rendering

Why

Version 0.4.4 of rb-ipynbdiff introduced a few performance degradations that are causing issues to customers (gitlab-org/incubation-engineering/mlops/rb-ipynbdiff#9 (closed)), and we need to block these from happening in the future

What

Adds a timeout to semantic notebook diffs, defaulting to raw diffs instead.

How to test

  1. Create a repository and add the offending file:

    mkdir outage_notebook
    cd outage_notebook
    curl https://gitlab.com/gitlab-org/incubation-engineering/mlops/rb-ipynbdiff/uploads/9c1f006ed70185d2029bc3d00b03574f/iterate.ipynb -o iterate.ipynb
    git init -b main
    git add -A 
    git commit -am "Adding offending notebook"
    git remote add origin <your local repository>
    git push --upstream origin main
  2. Without the changes, opening the commit will cause gitlab to hang

  3. With the changes, the raw diff will be displayed image

  4. For non-offending notebooks (http://gdk.test:3000/gitlab-org/gitlab-test/-/commit/5d6ed1503801ca9dc28e95eeb85a7cf863527aee), displays the semantic diff: image

Related to #354866 (closed)

Edited by Eduardo Bonet

Merge request reports