pt-query-digest outputs "Reading from STDIN"

Bug #1456324 reported by Ryan Olson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Triaged
Medium
Frank Cizmich

Bug Description

The 2.2.14 version of pt-query-digest will print "Reading from STDIN..." even when not in debug mode. From the surrounding code, it looks like this ought to be a debug statement, is the output necessary? Would something like the attached patch work?

Revision history for this message
Ryan Olson (ryan-t-olson) wrote :
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Hi Ryan,

It's not a debug statement. This was a compromise "fix". The original problem was that if you gave the tool a file to read, and that file did not exist, it would assume that instead of a file it was a given a DSN (because of a rare use case where a DSN can be passed as a parameter).
In that case the tool would assume that STDIN was the source, and just sit and wait, confusing the user.
So, as to not alter the current parameter format, but still avoid confusing the user, that message is printed.

If this affects you negatively please mention it. Maybe we can find an alternate solution.

Revision history for this message
Ryan Olson (ryan-t-olson) wrote :

Only problem is that it started causing some cronspam when we upgraded. I'm zcatting a slow query log file in logrotate and piping to pt-query-digest for Anemometer. If there was a way I could explicitly specify that I want stdin and have this message suppressed that would be great. In the meantime, I'm just "grep -v"ing the output.

Changed in percona-toolkit:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Frank Cizmich (frank-cizmich)
milestone: none → 2.3.1
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Ryan,

Would printing the message to STDERR solve this for you?

Revision history for this message
Ryan Olson (ryan-t-olson) wrote :

For me, probably not. I don't want to just filter off all STDERR because if something does in fact go wrong, I want to know about it. If we really do need this output in all circumstances if we're reading input from STDIN, I think my solution of doing a '| grep -v "Reading from STDIN"' is the best bet. Though I think I'd ultimately prefer a positive way to state "read from STDIN" that would tell the tool I know what I'm doing and don't need to see this output.

Not a huge deal either way, I've worked around it here.

tags: added: pt-query-digest
Changed in percona-toolkit:
milestone: 2.2.15 → none
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-685

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.