Skip to content

Can't use proper-lockfile while debugging memory leaks #71

Closed

Description

@achingbrain

I'm trying to debug memory leaks which involves generating heap dumps. This tends to peg the CPU - when it's done, the process explodes with:

/path/to/node_modules/proper-lockfile/lib/lockfile.js:181
        onCompromised: (err) => { throw err; },
                                  ^

Error: Unable to update lock within the stale threshold
    at options.fs.utimes (/path/to/node_modules/proper-lockfile/lib/lockfile.js:109:21)
    at FSReqWrap.oncomplete (fs.js:141:20)

Activity

  1. satazor commented on Feb 12, 2019

    @satazor
    Contributor

    This is the same issue that was reported on ipfs, @hugomrdias will be doing a PR to address the issue.

  2. achingbrain commented on Feb 19, 2019

    @achingbrain
    Author

    How about storing the last modification time after this module updates the lock? That way when proper-lockfile comes to updating the lock again, it can compare the current last modification time of the lockfile, and the last modification time when it updated the lock - if they are different then consider the lock stale.

    This way you don't have to rely on arbitrary timeouts which are too fragile to be used when the thread is suspended (in the case above) or when there is some CPU intensive work going on (in the IPFS case).

  3. satazor commented on Feb 19, 2019

    @satazor
    Contributor

    The solution we discussed a few weeks ago was indeed similar to what you described.

    It’s actually pretty easy to implement and to test. I don’t know if @hugomrdias is already on this though.

  4. pimlie commented on Mar 5, 2019

    @pimlie
    Contributor

    @satazor Do you maybe have a link to the ipfs issue you are referencing?

    We are seeing this same error using proper-lockfile when building a nuxt project on ci's as netlify and wercker

  5. hugomrdias commented on Mar 5, 2019

    @hugomrdias
    Contributor

    im working to fix this problem

  6. added a commit that references this issue on Mar 12, 2019
    9cc0973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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