You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
nodegit doesn't return control to the calling application #497
The NodeGit.* chain is working fine; the repo is being cloned and I'm getting the right commit message.
However, my application then just sits and waits. There's no indication in the nodegit docs that I need to manually resolve the Promise or anything like in order for my application to complete.
In the case of this happening in the context of a long-running process (i.e. express server) do you think the hang would be a problem? A little concerned that maybe it's hanging onto some kind of open connection and that over time this might cause problems...
@tbranyen well I've definitely been wrong before :)
@JediMindtrick if you want to try it out write a quick script that uses callback functions in the processing of a call that does open any connections. Nodegit.Status.foreach would do the trick. It should still hang after your script is finished processing.
I'm definitely looking into this more but at least we have a sort of work-around for right now.
The handles that were created for callback's being executed on the main thread needed to be cleaned up via uv_close. That's about to get merged into master which should fix this.
Also, @kevindashgit you offered no additional information necessary for us to assist you. Can you provide OS, Node version, NodeGit version, prebuilt or built from source, and the script that is failing?
No need to open a new issue, but if you want more rapid help, drop into our Gitter
Thanks so much for updating us with some more information, I'm probably not the best one to diagnose, but I'll try and reproduce locally to at least verify.
Ping @johnhaley81 who can assist, or know who best to assist.
@kevindashgit you're giving back wrong credentials and NodeGit will ask you for creds until you either pass back one that works or pass back NodeGit.Cred.defaultNew()
Activity
tbranyen commentedon Mar 19, 2015
How is it being used? Run that code in a single file and it'll exit just fine. Is your application hanging, because it's a server or something?
johnhaley81 commentedon Mar 19, 2015
How large is your repository? Have you set up any progress callbacks?
dancrumb commentedon Mar 19, 2015
@johnhaley81 the repo isn't that large and it's progressing fine (I added the callback to confirm).
The commit message is being reported, so we're getting that far. It's just that the application isn't closing.
dancrumb commentedon Mar 19, 2015
@tbranyen it's a CLI app and, when I remove the
NodeGitchain, it completes without any problems.tbranyen commentedon Mar 19, 2015
@dancrumb can you confirm if you run that code standalone on the CLI it exits?
johnhaley81 commentedon Mar 19, 2015
@dancrumb can you add a
.doneon the end of the chain?dancrumb commentedon Mar 19, 2015
I ran the script at https://gist.github.com/dancrumb/1b437d2d1da8b88ea62b and got the output:
where it just waits
tbranyen commentedon Mar 19, 2015
@dancrumb unfortunately that test case uses a logging tool that could be causing a problem:
here is a reduced test case I used that worked perfectly:
tbranyen commentedon Mar 19, 2015
Whoops, sorry about that, absentmindedly clicked the close button.
dancrumb commentedon Mar 19, 2015
I ran
and see the same behaviour.
I'm on Mint Linux, in a zshell on node 0.10.33
What are you on?
dancrumb commentedon Mar 19, 2015
I also checked with
git@github.com:nodegit/test... same problem (which is what I expected, but figured was worth checking)dancrumb commentedon Mar 19, 2015
Also seen on a Mac, zshell, node 0.11.14
johnhaley81 commentedon Mar 19, 2015
I'm getting the same behavior as @dancrumb. It just hangs. Looking into it more.
11 remaining items
JediMindtrick commentedon Mar 22, 2015
In the case of this happening in the context of a long-running process (i.e. express server) do you think the hang would be a problem? A little concerned that maybe it's hanging onto some kind of open connection and that over time this might cause problems...
tbranyen commentedon Mar 22, 2015
@JediMindtrick I seriously doubt it's hanging on to any kind of connection, @johnhaley81 is usually right about his hunches: #497 (comment)
johnhaley81 commentedon Mar 23, 2015
@tbranyen well I've definitely been wrong before :)
@JediMindtrick if you want to try it out write a quick script that uses callback functions in the processing of a call that does open any connections.
Nodegit.Status.foreachwould do the trick. It should still hang after your script is finished processing.I'm definitely looking into this more but at least we have a sort of work-around for right now.
This fixes polling sync promises in callbacks.
johnhaley81 commentedon Apr 20, 2015
The handles that were created for callback's being executed on the main thread needed to be cleaned up via
uv_close. That's about to get merged into master which should fix this.juanbrujo commentedon Apr 22, 2015
@johnhaley81 suggestion #497 (comment) definetly worked
johnhaley81 commentedon Apr 22, 2015
@juanbrujo this will be fixed in the next release FYI.
JediMindtrick commentedon Apr 22, 2015
@johnhaley81 Thanks for fixing this.
kevindashgit commentedon Mar 26, 2016
I don't see how this helps? I don't ever get to the
donepart of the promise chain. What am I missing?dancrumb commentedon Mar 26, 2016
You're probably better off open up a new issue with your failing choice
tbranyen commentedon Mar 26, 2016
Also, @kevindashgit you offered no additional information necessary for us to assist you. Can you provide OS, Node version, NodeGit version, prebuilt or built from source, and the script that is failing?
No need to open a new issue, but if you want more rapid help, drop into our Gitter
kevindashgit commentedon Mar 28, 2016
More Info:
OS: OSX El Capitan v10.11.1
Node Version: 1.2.0.10
NodeGit Version: ^0.11.9 (prebuilt)
Script:
tbranyen commentedon Mar 28, 2016
Thanks so much for updating us with some more information, I'm probably not the best one to diagnose, but I'll try and reproduce locally to at least verify.
Ping @johnhaley81 who can assist, or know who best to assist.
johnhaley81 commentedon Mar 29, 2016
@kevindashgit you're giving back wrong credentials and NodeGit will ask you for creds until you either pass back one that works or pass back
NodeGit.Cred.defaultNew()