pt-query-digest: specifying a file that doesn't exist as log causes the tool to wait for STDIN instead of giving an error

Bug #1404313 reported by Kenny Gryp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Low
Frank Cizmich

Bug Description

if you specify a file to process that does not exist, pt-query-digest waits forever. Often you will think that it's just slow to process, until you check and find out that it's not using any CPU at all.
<code>
Pertop:consulting gryp$ pt-query-digest filethatdoesntexist
^C# Caught SIGINT.
</code>

Basically, the tool waits for STDIN data.

The good behavior should be that pt-query-digest exits when the file is not found.

Changed in percona-toolkit:
assignee: nobody → Muhammad Irfan (muhammad-irfan)
Revision history for this message
Muhammad Irfan (muhammad-irfan) wrote :

Verified as described.

# pt-query-digest --version
pt-query-digest 2.2.12

# pt-query-digest dummy-slow.log

Tool runs foreever where dummy-slow.log doesn't exists on disk.

Changed in percona-toolkit:
assignee: Muhammad Irfan (muhammad-irfan) → nobody
status: New → Confirmed
Changed in percona-toolkit:
assignee: nobody → Frank Cizmich (frank-cizmich)
importance: Undecided → Low
milestone: none → 2.2.14
status: Confirmed → In Progress
Changed in percona-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Throwing a proper error proved impractical because of possible use case where the tool receives no file but does receive a DSN parameter. This DSN can consist of a single hostname, which is indistiguishable from a filename.

Workaround fix: Tool now announces it is waiting for STDIN , making the situation more obvious to the user.

Changed in percona-toolkit:
status: Fix Committed → Fix Released
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-817

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.