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

Disable pretty format restrictions when stdout is not TTY #63942

Merged

Conversation

azat
Copy link
Collaborator

@azat azat commented May 16, 2024

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Disable pretty format restrictions (output_format_pretty_max_rows/output_format_pretty_max_value_width) when stdout is not TTY

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 16, 2024
@robot-ch-test-poll2
Copy link
Contributor

robot-ch-test-poll2 commented May 16, 2024

This is an automated comment for commit 4348168 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS❌ failure
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process❌ failure
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@antaljanosbenjamin antaljanosbenjamin self-assigned this May 16, 2024
@antaljanosbenjamin
Copy link
Member

Is it okay for you to change category to Improvement?

@azat
Copy link
Collaborator Author

azat commented May 16, 2024

Is it okay for you to change category to Improvement?

Sure, done.

@alexey-milovidov
Copy link
Member

How to apply these limits when stdout is a tty? Needs a compatibility setting.

@azat
Copy link
Collaborator Author

azat commented May 18, 2024

How to apply these limits when stdout is a tty? Needs a compatibility setting.

If it is, then they simply works, this is just an overrides to make the output unlimited in case of i.e. chc | wc -l

@azat
Copy link
Collaborator Author

azat commented May 18, 2024

Upgrade check (debug) — Changed settings are not reflected in settings changes history (see changed_settings.txt)

I will apply the following hack for this - 8b61531 with a hope that it is not too ugly, but I don't have better idea (though later I think we could slightly rework how --interactive is handled for client, but let's not mix this changes in one PR)

@robot-ch-test-poll3 robot-ch-test-poll3 added pr-improvement Pull request with some product improvements and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels May 18, 2024
@azat
Copy link
Collaborator Author

azat commented May 18, 2024

Fast test — Some queries hung, fail: 0, passed: 5438, skipped: 1139

2024-05-18 16:01:37 Found hung queries in processlist:
2024-05-18 16:03:28 Row 1:
2024-05-18 16:03:28 ──────
2024-05-18 16:03:28 is_initial_query:     1
2024-05-18 16:03:28 user:                 default
2024-05-18 16:03:28 query_id:             b92bbf41-fe79-4b51-8f29-6cfa681c36f9
2024-05-18 16:03:28 address:              ::ffff:127.0.0.1
2024-05-18 16:03:28 port:                 50330
2024-05-18 16:03:28 initial_user:         default
2024-05-18 16:03:28 initial_query_id:     b92bbf41-fe79-4b51-8f29-6cfa681c36f9
2024-05-18 16:03:28 initial_address:      ::ffff:127.0.0.1
2024-05-18 16:03:28 initial_port:         50330
2024-05-18 16:03:28 interface:            1
2024-05-18 16:03:28 os_user:              
2024-05-18 16:03:28 client_hostname:      ip-172-31-90-205.ec2.internal
2024-05-18 16:03:28 client_name:          ClickHouse client
2024-05-18 16:03:28 client_revision:      54468
2024-05-18 16:03:28 client_version_major: 24
2024-05-18 16:03:28 client_version_minor: 5
2024-05-18 16:03:28 client_version_patch: 1
2024-05-18 16:03:28 http_method:          0
2024-05-18 16:03:28 http_user_agent:      
2024-05-18 16:03:28 http_referer:         
2024-05-18 16:03:28 forwarded_for:        
2024-05-18 16:03:28 quota_key:            
2024-05-18 16:03:28 distributed_depth:    0
2024-05-18 16:03:28 elapsed:              365.695545
2024-05-18 16:03:28 is_cancelled:         0
2024-05-18 16:03:28 is_all_data_sent:     0
2024-05-18 16:03:28 read_rows:            0
2024-05-18 16:03:28 read_bytes:           0
2024-05-18 16:03:28 total_rows_approx:    0
2024-05-18 16:03:28 written_rows:         0
2024-05-18 16:03:28 written_bytes:        0
2024-05-18 16:03:28 memory_usage:         58718785
2024-05-18 16:03:28 peak_memory_usage:    62446670
2024-05-18 16:03:28 query:                SELECT sum(sleepEachRow(1)) FROM remote('127.{2..21}', system.one)
2024-05-18 16:03:28 query_kind:           Select
2024-05-18 16:03:28 thread_ids:           [182580,207110]
2024-05-18 16:03:28 ProfileEvents:        {'Query':1,'SelectQuery':1,'InitialQuery':1,'QueriesWithSubqueries':24,'SelectQueriesWithSubqueries':24,'ReadCompressedBytes':1712,'CompressedReadBufferBlocks':18,'CompressedReadBufferBytes':1343,'IOBufferAllocs':66,'IOBufferAllocBytes':52435167,'TableFunctionExecute':1,'NetworkReceiveElapsedMicroseconds':64860,'NetworkSendElapsedMicroseconds':4301,'NetworkReceiveBytes':125844,'NetworkSendBytes':82794,'DistributedConnectionTries':18,'DistributedConnectionUsable':16,'SuspendSendingQueryToShard':31,'ContextLock':66,'RWLockAcquiredReadLocks':2,'RealTimeMicroseconds':87696,'UserTimeMicroseconds':8871,'SystemTimeMicroseconds':1468,'SoftPageFaults':152,'OSCPUWaitMicroseconds':15,'OSCPUVirtualTimeMicroseconds':10339,'OSWriteBytes':12288,'OSReadChars':1356,'OSWriteChars':18043,'QueryProfilerRuns':730,'LogTrace':96,'LogDebug':16,'LogInfo':1}
2024-05-18 16:03:28 Settings:             {'max_threads':'1','max_distributed_connections':'20','connect_timeout_with_failover_ms':'2000','connect_timeout_with_failover_secure_ms':'3000','idle_connection_timeout':'36000','s3_check_objects_after_upload':'1','stream_like_engine_allow_direct_select':'1','replication_wait_for_inactive_replica_timeout':'30','allow_nonconst_timezone_arguments':'1','log_queries':'1','insert_quorum_timeout':'60000','fsync_metadata':'0','http_send_timeout':'60','http_receive_timeout':'60','opentelemetry_start_trace_probability':'0.1','max_untracked_memory':'1048576','memory_profiler_step':'1048576','log_comment':'01085_max_distributed_connections.sh','send_logs_level':'warning','allow_introspection_functions':'1','database_atomic_wait_for_drop_and_detach_synchronously':'1','distributed_ddl_entry_format_version':'6','async_insert_busy_timeout_max_ms':'5000','load_marks_asynchronously':'1','allow_prefetched_read_pool_for_remote_filesystem':'0','allow_prefetched_read_pool_for_local_filesystem':'0','filesystem_prefetch_max_memory_usage':'1073741824','insert_keeper_max_retries':'100','insert_keeper_retry_initial_backoff_ms':'1','insert_keeper_retry_max_backoff_ms':'1','insert_keeper_fault_injection_probability':'0.01'}
2024-05-18 16:03:28 current_database:     test_n1xykq7s
2024-05-18 16:03:28 stacktraces:          Thread ID 182580
2024-05-18 16:03:28 /fasttest-workspace/build/./src/Common/StackTrace.cpp:347::StackTrace::StackTrace(ucontext const&)
2024-05-18 16:03:28 /fasttest-workspace/build/./src/Storages/System/StorageSystemStackTrace.cpp:107::DB::(anonymous namespace)::signalHandler(int, siginfo_t*, void*)Thread ID 207110
2024-05-18 16:03:28 /fasttest-workspace/build/./src/Common/StackTrace.cpp:347::StackTrace::StackTrace(ucontext const&)
2024-05-18 16:03:28 /fasttest-workspace/build/./src/Storages/System/StorageSystemStackTrace.cpp:107::DB::(anonymous namespace)::signalHandler(int, siginfo_t*, void*)
2024-05-18 16:03:28 None

But no proper stacktraces due to musl build... Will do a rebase

@azat azat force-pushed the client-pretty-format-tty-only branch from 8b61531 to f865b7b Compare May 18, 2024 14:10
@alexey-milovidov
Copy link
Member

If I want to redirect the output but still apply the same limits, how could it be done?

@azat
Copy link
Collaborator Author

azat commented May 18, 2024

Pass them explicitly, since they adjusted only if not changed

azat added 2 commits May 20, 2024 10:19
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
settings changes check simply checks that the settings are either the
same, or there is a record in system.settings_changes, however, the
problem is that clickhouse-local now adjusts some settings for Pretty
format in case of stdout is not a tty, and this is the case for this
check.

So to avoid this, just run the clickhouse-local under script(1) to fool
it.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat azat force-pushed the client-pretty-format-tty-only branch from f865b7b to 4348168 Compare May 20, 2024 08:19
@azat
Copy link
Collaborator Author

azat commented May 20, 2024

ClickHouse special build check — 14/16 artifact groups are OK

  • binary_riscv64
May 20 12:39:20 prlimit --as=10000000000 --data=5000000000 --cpu=1800 /usr/bin/sccache /usr/bin/clang++-18 --target=riscv64-linux-gnu --sysroot=/build/cmake/linux/../../contrib/sysroot/linux-riscv64 -DANNOYLIB_MULTITHREADED_BUILD -DBOOST_ASIO_HAS_STD_INVOKE_RESULT=1 -DBOOST_ASIO_STANDALONE=1 -DBOOST_TIMER_ENABLE_DEPRECATED=1 -DCONFIGDIR=\"\" -DDUMMY_BACKTRACE -DENABLE_ANNOY -DENABLE_MULTITARGET_CODE=1 -DENABLE_USEARCH -DHAVE_BZLIB_H=1 -DHAVE_CONFIG_H -DHAVE_FUTIMESAT=1 -DHAVE_ICONV=1 -DHAVE_LIBLZMA=1 -DHAVE_LIBZSTD=1 -DHAVE_LIBZSTD_COMPRESSOR=1 -DHAVE_LINUX_FS_H=1 -DHAVE_LINUX_TYPES_H=1 -DHAVE_LZMA_H=1 -DHAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_ZLIB_H=1 -DHAVE_ZSTD_H=1 -DINCBIN_SILENCE_BITCODE_WARNING -DLIBSASL_EXPORTS=1 -DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DLZ4_FAST_DEC_LOOP=1 -DMAJOR_IN_SYSMACROS=1 -DOBSOLETE_CRAM_ATTR=1 -DOBSOLETE_DIGEST_ATTR=1 -DPLUGINDIR=\"\" -DPOCO_ENABLE_CPP11 -DPOCO_HAVE_FD_EPOLL -DPOCO_OS_FAMILY_UNIX -DSASLAUTHD_CONF_FILE_DEFAULT=\"\" -DSNAPPY_CODEC_AVAILABLE -DSTD_EXCEPTION_HAS_STACK_TRACE=1 -DUSE_CLICKHOUSE_THREADS=1 -DWITH_COVERAGE=0 -DWITH_GZFILEOP -DZLIB_COMPAT -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D_LIBUNWIND_IS_NATIVE_ONLY -I/build/build_docker/includes/configs -I/build/src -I/build/build_docker/src -I/build/build_docker/src/Core/include -I/build/base/base/.. -I/build/build_docker/base/base/.. -I/build/contrib/cctz/include -I/build/contrib/re2 -I/build/base/pcg-random/. -I/build/contrib/libfiu/libfiu -I/build/contrib/libssh/include -I/build/build_docker/contrib/libssh/include -I/build/contrib/miniselect/include -I/build/contrib/zstd/lib -I/build/contrib/pocketfft -I/build/contrib/libarchive-cmake -I/build/contrib/libarchive/libarchive -I/build/build_docker/contrib/cyrus-sasl-cmake -I/build/contrib/lz4/lib -isystem /build/contrib/llvm-project/libcxx/include -isystem /build/contrib/llvm-project/libcxxabi/include -isystem /build/contrib/libunwind/include -isystem /build/contrib/libdivide-cmake/. -isystem /build/contrib/libdivide -isystem /build/contrib/jemalloc-cmake/include -isystem /build/contrib/llvm-project/llvm/include -isystem /build/build_docker/contrib/llvm-project/llvm/include -isystem /build/contrib/abseil-cpp -isystem /build/contrib/croaring/cpp -isystem /build/contrib/croaring/include -isystem /build/contrib/sparsehash-c11 -isystem /build/contrib/incbin -isystem /build/contrib/cityhash102/include -isystem /build/contrib/boost -isystem /build/base/poco/Net/include -isystem /build/base/poco/Foundation/include -isystem /build/base/poco/NetSSL_OpenSSL/include -isystem /build/base/poco/Crypto/include -isystem /build/contrib/openssl-cmake/linux_riscv64/include -isystem /build/contrib/openssl/include -isystem /build/base/poco/Util/include -isystem /build/base/poco/JSON/include -isystem /build/base/poco/XML/include -isystem /build/contrib/replxx/include -isystem /build/contrib/fmtlib-cmake/../fmtlib/include -isystem /build/contrib/magic_enum/include -isystem /build/contrib/double-conversion -isystem /build/contrib/dragonbox/include -isystem /build/contrib/zlib-ng -isystem /build/build_docker/contrib/zlib-ng-cmake -isystem /build/contrib/pdqsort -isystem /build/contrib/xz/src/liblzma/api -isystem /build/contrib/aws/src/aws-cpp-sdk-core/include -isystem /build/build_docker/contrib/aws-cmake/include -isystem /build/contrib/aws/generated/src/aws-cpp-sdk-s3/include -isystem /build/contrib/aws-c-auth/include -isystem /build/contrib/aws-c-common/include -isystem /build/contrib/aws-c-io/include -isystem /build/contrib/aws-crt-cpp/include -isystem /build/contrib/aws-c-mqtt/include -isystem /build/contrib/aws-c-sdkutils/include -isystem /build/contrib/azure/sdk/core/azure-core/inc -isystem /build/contrib/azure/sdk/identity/azure-identity/inc -isystem /build/contrib/azure/sdk/storage/azure-storage-common/inc -isystem /build/contrib/azure/sdk/storage/azure-storage-blobs/inc -isystem /build/contrib/snappy -isystem /build/build_docker/contrib/snappy-cmake -isystem /build/contrib/libbcrypt -isystem /build/contrib/msgpack-c/include -isystem /build/build_docker/contrib/liburing/src/include-compat -isystem /build/build_docker/contrib/liburing/src/include -isystem /build/contrib/liburing/src/include -isystem /build/contrib/fast_float/include -isystem /build/contrib/librdkafka-cmake/include -isystem /build/contrib/librdkafka/src -isystem /build/build_docker/contrib/librdkafka-cmake/auxdir -isystem /build/contrib/cppkafka/include -isystem /build/contrib/nats-io/src -isystem /build/contrib/nats-io/src/adapters -isystem /build/contrib/nats-io/src/include -isystem /build/contrib/nats-io/src/unix -isystem /build/contrib/libuv/include -isystem /build/contrib/krb5/src/include -isystem /build/build_docker/contrib/krb5-cmake/include -isystem /build/contrib/NuRaft/include -isystem /build/base/poco/MongoDB/include -isystem /build/base/poco/Redis/include -isystem /build/contrib/icu/icu4c/source/i18n -isystem /build/contrib/icu/icu4c/source/common -isystem /build/contrib/capnproto/c++/src -isystem /build/contrib/avro/lang/c++/api -isystem /build/contrib/google-protobuf/src -isystem /build/contrib/s2geometry/src -isystem /build/contrib/s2geometry-cmake -isystem /build/contrib/AMQP-CPP/include -isystem /build/contrib/AMQP-CPP -isystem /build/contrib/sqlite-amalgamation -isystem /build/contrib/rocksdb/include -isystem /build/contrib/libpqxx/include -isystem /build/contrib/libpq -isystem /build/contrib/libpq/include -isystem /build/contrib/libstemmer_c/include -isystem /build/contrib/wordnet-blast -isystem /build/contrib/lemmagen-c/include -isystem /build/contrib/ulid-c/include -isystem /build/contrib/simdjson/include -isystem /build/contrib/rapidjson/include -isystem /build/contrib/consistent-hashing -isystem /build/contrib/annoy/src -isystem /build/contrib/FP16/include -isystem /build/contrib/robin-map/include -isystem /build/contrib/SimSIMD-map/include -isystem /build/contrib/usearch/include --gcc-toolchain=/build/cmake/linux/../../contrib/sysroot/linux-riscv64 -fdiagnostics-color=always -Xclang -fuse-ctor-homing -Wno-enum-constexpr-conversion -fsized-deallocation  -gdwarf-aranges -pipe -fasynchronous-unwind-tables -ffile-prefix-map=/build=. -ftime-trace -falign-functions=32 -ffp-contract=off  -fdiagnostics-absolute-paths -fstrict-vtable-pointers -Wall -Wextra -Wframe-larger-than=65536 -Weverything -Wpedantic -Wno-zero-length-array -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-c++20-compat -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-implicit-int-float-conversion -Wno-ctad-maybe-unsupported -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors -Wno-float-equal -Wno-global-constructors -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded -Wno-switch-enum -Wno-undefined-func-template -Wno-unused-template -Wno-vla -Wno-weak-template-vtables -Wno-weak-vtables -Wno-thread-safety-negative -Wno-enum-constexpr-conversion -Wno-unsafe-buffer-usage -Wno-switch-default -O2 -g -DNDEBUG -O3 -g  -fno-pie -std=c++23   -D OS_LINUX -Werror -Wno-deprecated-declarations -Wno-poison-system-directories -nostdinc++ -MD -MT src/CMakeFiles/dbms.dir/Functions/FunctionsConversion.cpp.o -MF src/CMakeFiles/dbms.dir/Functions/FunctionsConversion.cpp.o.d -o src/CMakeFiles/dbms.dir/Functions/FunctionsConversion.cpp.o -c /build/src/Functions/FunctionsConversion.cpp
May 20 12:39:20 sccache: warning: The server looks like it shut down unexpectedly, compiling locally instead
May 20 12:39:20 sccache: Compile terminated by signal 9
  • binary_loongarch64 - compiled successfully, but by some reason the process failed

@alexey-milovidov alexey-milovidov merged commit a5ae7c2 into ClickHouse:master May 20, 2024
210 of 222 checks passed
@azat azat deleted the client-pretty-format-tty-only branch May 20, 2024 15:25
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants