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

hierarchy-lookup may be the cause of hanging imports #2

Closed
sevko opened this issue Jan 22, 2015 · 2 comments
Closed

hierarchy-lookup may be the cause of hanging imports #2

sevko opened this issue Jan 22, 2015 · 2 comments

Comments

@sevko
Copy link
Contributor

sevko commented Jan 22, 2015

After running several imports via pelias/openaddresses, I noticed that they'd hang whenever I pipe()d data through hierarchy-lookup. It might be the cause of the hanging imports we see in production, and, after some digging, these lines look suspect:

function(){
  // close the adapter when done
  // @TODO: this might not be ideal in some cases
  opts.backends[0].adapter.client.close();
});

As per the through2 documentation, the flush function receives a callback argument that it should invoke before exiting. Adding that made the import exit as expected, but another problem popped up right before it did:

esclient error { [Error: No Living connections] message: 'No Living connections' }

I queried localhost:9200/pelias/_count and came up about 500 records short of what I expected. I suspect that opts.backends[0].adapter.client.close(); globally closes connections to elasticsearch, since commenting that out resolved the problem. If we don't need it, we can get rid of the flush function entirely.

sevko added a commit that referenced this issue Jan 23, 2015
lib/stream.js
	-Work on a potential solution to #2, by a.) removing an
	unnecessary call to close the package's elasticsearch connection
	in a flush function, and b.) then removing the incorrect flush
	function itself (it was missing a call to the `end` parameter).
@sevko sevko closed this as completed in f2c9d71 Jan 23, 2015
@missinglink
Copy link
Member

Let's have a chat about this issue, it's most likely the source of the 'process not exiting' issues and we can probably do something better to avoid it.

@sevko
Copy link
Contributor Author

sevko commented Feb 9, 2015

This was the problem for openaddresses, which depends on this package, and removing the flush function resolved it. openstreetmap doesn't replicate this code and has a separate issue, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants