Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

takePicture a file descriptor opened causing "too many files opened" error #61

Closed
rformato opened this issue Sep 16, 2014 · 6 comments
Closed

Comments

@rformato
Copy link

It seems like each time takePicture is called, a new file descriptor is created and never closed, bringing to an error in the long run when no more file descriptor can be created.

You can just loop a takePicture call and launch this shell command
lsof | grep node

to see how many opened files you have

Can you confirm it's a file descriptor leak?

@rformato
Copy link
Author

I think the line causing not closing file descriptors is
https://github.com/lwille/node-gphoto2/blob/master/src/camera_helpers.cc#L346

Files are closed only if both target_path and socket_path are not empty

@lpinca
Copy link
Contributor

lpinca commented Sep 21, 2014

@rformato i think that you are right, if this if (!req->target_path.empty() || !req->socket_path.empty()) { fixes the issue make a pull request, @lwille will probably merge it.

@lwille
Copy link
Owner

lwille commented Oct 24, 2014

Please confirm the fix by @Sija - it's merged and looks fine, but I can't run any tests here.

@Sija
Copy link
Collaborator

Sija commented Oct 24, 2014

I'm testing it for the last few days and I can confirm it's working damn fine! :)
Edit: nvm; @lwille I misread your comment and thought it's directed at me.

@lwille
Copy link
Owner

lwille commented Oct 25, 2014

I'm sure it does :)
I'll push a new release as soon as I'm back home.

@lwille
Copy link
Owner

lwille commented Jan 19, 2015

Should be fixed in 0.1.7 (ba9a9b9)

@lwille lwille closed this as completed Jan 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants