Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Remove uses of nodegit #12159

Closed
Closed
@maxbrunsfeld

Description

@maxbrunsfeld

We're seeing crashes in Atom stable. We believe that the crashes are caused by nodegit (introduced in #9213). So for now, we're going to back out all of our usage of nodegit in core and bundled packages:

Refs #12153

Activity

lee-dohm

lee-dohm commented on Jul 13, 2016

@lee-dohm
Contributor

I suspect #11358 is related to this also.

subesokun

subesokun commented on Jul 17, 2016

@subesokun
Contributor

@maxbrunsfeld @lee-dohm Does this mean that the new async Git API will be removed for the time being and it's unclear if it will be shipped again in Atom 1.10?

This causes quite some troubles for me as I've already completely migrated the tree-view-git-status package onto the new async API as the old sync API didn't work any longer. It was really a big effort to migrate to the async API and now I've to undo everything again? ... just wondering why such breaking changes are not causing a major version bump of Atom ...

lgeiger

lgeiger commented on Nov 20, 2017

@lgeiger
Contributor

@maxbrunsfeld @lee-dohm @smashwilson I there a way we could revisit this issue?

Opening a git repository over a the network (e.g. via a SSHFS mounted network drive) can take multiple seconds. Due to the synchronous git-utils API this may completely block Atom which makes accessing git repositories over Wifi completely unusable.

Here is a CPU profile that illustrates this issue when adding a remote git repository to the tree view:
git-repo.zip

I'm happy to help with this problem and provide more information if needed.

maxbrunsfeld

maxbrunsfeld commented on Nov 21, 2017

@maxbrunsfeld
ContributorAuthor

@lgeiger Yeah, this is a really big known problem, and I think it needs to be a fairly high priority for us. We definitely want to remove all uses of synchronous git-utils calls. I don't think that necessarily means we're going to use nodegit again (although that is an option). We've already replaced some of the synchronous APIs in git-utils with async ones: see atom/git-utils#80, and that has been fairly painless. I don't know the status of nodegit since we attempted to use it in Atom (and experienced intermittent crashes) last year.

It's great to hear that you're interested in helping. There are three main components to this effort:

  1. Implement async versions of all of our GitRepository APIs. I can see two ways of doing this:
    a. Add async variants of these methods to git-utils, similar to what I did in Add a few async APIs needed by Atom git-utils#80.
    b. Implement these methods using nodegit, and verify with very high confidence that nodegit won't cause the app to crash anymore.
  2. Update all of our bundled packages to use the new APIs.
  3. Deprecate the old synchronous APIs.

Do you have thoughts on this? Would you like to help do some of this work?

lgeiger

lgeiger commented on Jan 4, 2018

@lgeiger
Contributor

Thanks for the detailed explanation!
Sorry for not getting back to you earlier.

I didn't find time to try one of the above options but for now I made some CPU profiles to help illustrate the problem. All of the profiles where taken using a network mounted folder via sshfs while on a stable wireless internet connection.

Adding git repo to project and open file

add_project_and_open

Open file from already loaded git repo

open_file_from_loaded_project

Here is the full profile: sshfs_load.zip

Have you though about making use of the github package to get the diff and status of the repo?
It shells out via dugite instead of relying on git-utils/libgit2. Apart from that it would remove the need to maintain two different git tools bundled inside Atom.

lock

lock commented on Jul 3, 2018

@lock

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

locked as resolved and limited conversation to collaborators on Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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

    Remove uses of nodegit · Issue #12159 · atom/atom