Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zvictorino
Copy link

While running esm, it would exhaust all the local ports.
How to repeat:
Set parameter -c to 1,run esm, after 10 minutes, use netstat command to check the local established connections.

netstat -atnp|grep ESTABLISHED|grep esm|wc -l
51566

After a while, esm raised lots of errors.

[04-13 17:51:01] [ERR] [scroll.go:49,Next] Get http://192.168.1.1:9200/_search/scroll?scroll=10m&scroll_id=DnF1ZXJ5VGhlbkZldGNoBQAAAAAITenFFm9GdnEzeUdWUVVDYS1wdUhmc0d5Z3cAAAAAag6USRZyYVVTVVZCTVRZbXBKdmE0Y2lpajR3AAAAAGoOlEgWcmFVU1VWQk1UWW1wSnZhNGNpaWo0dwAAAABnzS3JFnNhNmdBWW1hUU91OGtfTS11aHYxeUEAAAAACE3pxhZvRnZxM3lHVlFVQ2EtcHVIZnNHeWd3: dial tcp 192.168.1.2:9200: connect: cannot assign requested address

This is because, the default HTTP client's Transport does not attempt to reuse HTTP/1.0 or HTTP/1.1 TCP connections ("keep-alive") unless the Body is read to completion and is closed. And the code just calls
resp.Body.Close() and the body isn't cleared.
This paper has details about the problem.

fix can't assign requested address
fix can't assign requested address
fix can't assign requested address
bool default no more needed
Add "fields" parameter to output specified field.
Add "fields" parameter to output specified field.
Add "fields" parameter to output specified field.
Add "fields" parameter to output specified field.
Add "fields" parameter to output specified field.
domain.go Outdated
ScrollTime string `short:"t" long:"time" description:"scroll time" default:"1m"`
ScrollSliceSize int `long:"sliced_scroll_size" description:"size of sliced scroll, to make it work, the size should be > 1" default:"1"`
RecreateIndex bool `short:"f" long:"force" description:"delete destination index before copying" default:"false"`
RecreateIndex bool `short:"f" long:"force" description:"delete destination index before copying" `
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you keep this default to false, same below

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the code of packge go-flags had been changed, boolean flag always default to `false' .
https://github.com/jessevdk/go-flags/blob/master/group.go

	if option.isBool() && option.Default != nil {
		return newErrorf(ErrInvalidTag,
			"boolean flag `%s' may not have default values, they always default to `false' and can only be turned on",
			option.shortAndLongName())
	}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++,Good!

medcl added 2 commits May 15, 2018 15:42
prefer to safe default
fix header
@medcl medcl merged commit 64e92d1 into medcl:master Jun 4, 2018
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

Successfully merging this pull request may close these issues.

2 participants