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

Stop trying to connect to yourself and spamming the logs #1305

Closed
tomwilkie opened this issue Aug 16, 2015 · 2 comments
Closed

Stop trying to connect to yourself and spamming the logs #1305

tomwilkie opened this issue Aug 16, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@tomwilkie
Copy link
Contributor

I start weave and pass every peer the same set of IPs, which happens to include their own. The logs are full of messages like this:

INFO: 2015/08/16 10:28:26.594151 ->[172.31.13.96:6783] attempting connection
INFO: 2015/08/16 10:28:26.594664 ->[172.17.42.1:50625] connection accepted
ERRO: 2015/08/16 10:28:26.595323 ->[172.31.13.96:6783|fe:09:5f:88:03:b4(ip-172-31-13-96)]: connection shutting down due to error: Cannot connect to ourself
ERRO: 2015/08/16 10:28:26.595593 ->[172.17.42.1:50625|fe:09:5f:88:03:b4(ip-172-31-13-96)]: connection shutting down due to error: Cannot connect to ourself
INFO: 2015/08/16 10:33:44.324598 ->[172.31.13.96:6783] attempting connection
INFO: 2015/08/16 10:33:44.324989 ->[172.17.42.1:50638] connection accepted
ERRO: 2015/08/16 10:33:44.325565 ->[172.31.13.96:6783|fe:09:5f:88:03:b4(ip-172-31-13-96)]: connection shutting down due to error: Cannot connect to ourself
ERRO: 2015/08/16 10:33:44.325803 ->[172.17.42.1:50638|fe:09:5f:88:03:b4(ip-172-31-13-96)]: connection shutting down due to error: Cannot connect to ourself

Could we either remember that the IP pointed to ourself, and stop trying to connect to it, or only log errors if they are different from last time?

@rade rade added the chore label Aug 16, 2015
@bboreham
Copy link
Contributor

As noted at #611, the weave router is running inside a container and containers do not generally know their externally-visible address. And NAT mappings can change so it is dangerous to cache the results of a particular connection. Although perhaps a mapping to ourself is unlikely to change.

Only logging errors when they change is an interesting idea.

@rade
Copy link
Member

rade commented Aug 17, 2015

perhaps a mapping to ourself is unlikely to change.

That.

Only logging errors when they change is an interesting idea.

We need the error log message in order to 'close' the connection lifecycle in the logs. Also, surely the 'attempting/accepted' log messages are just as annoying. But suppressing those would mean not logging anything for some connections, which is a bad idea IMO.

@rade rade self-assigned this Aug 17, 2015
rade added a commit that referenced this issue Aug 17, 2015
When we discover that a connection target address leads to ourself we
set the retry time to the zero time.Time value - the only special
time.Time value. We use that marker to a) suppress subsequent
connection attempts, and b) display the next retry as 'never' in
`weave status|report`.

Closes #1305.
This was referenced Aug 17, 2015
@rade rade modified the milestone: 1.1.0 Aug 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants