PT-2052 - Tools should default to unbuffered stdout/stderr

- Added option --[no]buffer-stdout, enabled by default
This commit is contained in:
Sveta Smirnova
2025-08-05 18:24:01 +03:00
parent 607f5a2188
commit 734d6231c2
26 changed files with 272 additions and 0 deletions

View File

@@ -528,6 +528,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -1266,6 +1270,13 @@ L<"SYNOPSIS"> and usage information for details.
=over
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --help
Show help and exit.

View File

@@ -1257,6 +1257,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -7769,6 +7773,13 @@ The danger is that a crash might cause lost data.
The performance increase I have seen from using L<"--buffer"> is around 5 to 15
percent. Your mileage may vary.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --bulk-delete
Delete each chunk with a single statement (implies L<"--commit-each">).

View File

@@ -1255,6 +1255,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -5738,6 +5742,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -605,6 +605,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -5336,6 +5340,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -601,6 +601,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -5474,6 +5478,13 @@ L<"SYNOPSIS"> and usage information for details.
=over
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --columns-regex
type: string; default: .

View File

@@ -1660,6 +1660,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -5451,6 +5455,13 @@ as a FULLTEXT index is not really a duplicate, for example.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -529,6 +529,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -1567,6 +1571,13 @@ L<"SYNOPSIS"> and usage information for details.
=over
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --config
type: Array

View File

@@ -1048,6 +1048,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -4562,6 +4566,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --case-insensitive
Specifies that all regular expression searches are case-insensitive.

View File

@@ -530,6 +530,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -2137,6 +2141,13 @@ L<"SYNOPSIS"> and usage information for details.
=over
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --config
type: Array

View File

@@ -600,6 +600,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -4459,6 +4463,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -1558,6 +1558,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -7102,6 +7106,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -1214,6 +1214,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -7200,6 +7204,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -610,6 +610,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -8005,6 +8009,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -667,6 +667,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -12923,6 +12927,13 @@ This is useful when you change large tables with keys that include a binary
data type or that have non-standard character sets.
See L<"--history"> and L<"--resume">.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --channel
type: string

View File

@@ -1882,6 +1882,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -15699,6 +15703,13 @@ values for attributes. If the attribute's value is bigger than this, the
last-seen value for that class of query is used instead.
Disabled by default.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -538,6 +538,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -4404,6 +4408,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -760,6 +760,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -5910,6 +5914,13 @@ pt-replica-restart will not let you stop the replica manually if you want to!
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -531,6 +531,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -2402,6 +2406,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -604,6 +604,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}

View File

@@ -2364,6 +2364,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -13306,6 +13310,13 @@ group: Connection
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --channel
type: string

View File

@@ -618,6 +618,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -12492,6 +12496,13 @@ For most non-trivial data sizes, you want to leave this option enabled.
This option is disabled when L<"--bidirectional"> is used.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --channel
type: string

View File

@@ -1650,6 +1650,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -8259,6 +8263,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -1879,6 +1879,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -11091,6 +11095,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -607,6 +607,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -6100,6 +6104,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -1217,6 +1217,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}
@@ -3946,6 +3950,13 @@ L<"SYNOPSIS"> and usage information for details.
Prompt for a password when connecting to MySQL.
=item --[no]buffer-stdout
default: yes
Enables STDOUT buffering. Disable this option if you want to see live progress
when using output post-processing tools such as C<tee> or C<kubectl logs>.
=item --charset
short form: -A; type: string

View File

@@ -668,6 +668,10 @@ sub get_opts {
}
}
if ( exists $self->{opts}->{'buffer-stdout'} && $self->{opts}->{'buffer-stdout'}->{got} ) {
STDOUT->autoflush(1 - $self->{opts}->{'buffer-stdout'}->{value});
}
if ( @ARGV && $self->{strict} ) {
$self->save_error("Unrecognized command-line options @ARGV");
}