Bug 545 - information on the failed query for error "error: tcp writev: Connection reset by peer"
information on the failed query for error "error: tcp writev: Connection rese...
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
Other All
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-16 18:31 CET by Carsten Strotmann
Modified: 2014-04-10 16:44 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Strotmann 2014-01-16 18:31:02 CET
Hello Unbound team,

happy new year 2014!

I have a improvement request:

to provide additional information (source IP of the query, query name, record type, class) on this error message (and similar kind of errors).

Error message today:
"error: tcp writev: Connection reset by peer"

It would greatly help to troubleshooting the issues, esp. on a multi-threaded Unbound install under heavy load.
Comment 1 Wouter Wijngaards 2014-01-17 11:20:40 CET
Hi Carsten,

Happy new year!

It should already print the source IP on the logline after the error:
remote address is <IP>

The query details are not actually available in the piece of code that prints this error, ..  We could spend some effort on decoding it and printing the qname, type, class.  What verbosity level would you think this should be performed at?

Best regards,
    Wouter
Comment 2 Carsten Strotmann 2014-01-20 09:38:59 CET
(In reply to comment #1)

Hi Wouter,

> It should already print the source IP on the logline after the error:
> remote address is <IP>

I have two reasons to output error message and IP address in one line:
1) it makes it simpler to 'grep' for the error and have all information in one place
2) in an very busy multithreaded/forked Unbound, there could be other log messages from other threads printed in-between the first log-line (containing the error) and the 2nd (containing the IP), making it hard to correlate the data

> 
> The query details are not actually available in the piece of code that
> prints this error, ..  We could spend some effort on decoding it and
> printing the qname, type, class.  What verbosity level would you think this
> should be performed at?
> 

I would like it on the same level as the message, which is "ERROR". However the (remote) IP address is the most important piece of information. If decoding the other information will be a performance penalty (even if only in case of an error), it might be a tradeoff not important enough.

Best regards

Carsten
Comment 3 Wouter Wijngaards 2014-01-20 09:50:10 CET
Hi Carsten,

Yes decoding would be a performance hit (in case of error).  But merging the lines into one report line is likely possible with little performance penalty (but a couple lines of code).  I'll look into it.

Best regards, Wouter
Comment 4 Wouter Wijngaards 2014-04-10 16:44:01 CEST
Hi Carsten,

Implemented.  Not just for writev: but also other error printouts, like read, write, connect...

Best regards,
   Wouter