Skip to content

WriteBufferFromS3 is not finalized in destructor. It's a bug #38158

@qoega

Description

@qoega

debug+asan build.

2022.06.16 20:04:35.084625 [ 1570360 ] {cf6a186d-a1b3-45c2-a284-658673c0308a} <Error> executeQuery: Code: 499. DB::Exception: Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 22.6.1.1). (S3_ERROR) (version 22.6.1.1) (from 127.0.0.1:58804) (comment: '02207_s3_content_type.sh') (in query:  INSERT INTO TABLE FUNCTION s3('http://localhost:11111/test/content-type.csv', 'test', 'testtest', 'CSV', 'number UInt64') SELECT number FROM numbers(1000000) SETTINGS s3_max_single_part_upload_size = 10000, s3_truncate_on_insert = 1; ), Stack trace (when copying this message, always include the lines below):

0. /build/build_docker/../contrib/libcxx/include/exception:133: std::exception::capture() @ 0x1bf15ce2 in /home/ubuntu/address-ch/output/clickhouse
1. /build/build_docker/../contrib/libcxx/include/exception:111: std::exception::exception() @ 0x1bf15cba in /home/ubuntu/address-ch/output/clickhouse
2. /build/build_docker/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x51e1f7e0 in /home/ubuntu/address-ch/output/clickhouse
3. /build/build_docker/../src/Common/Exception.cpp:67: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x1c01819e in /home/ubuntu/address-ch/output/clickhouse
4. /build/build_docker/../src/IO/WriteBufferFromS3.cpp:225: DB::WriteBufferFromS3::createMultipartUpload() @ 0x409ead8e in /home/ubuntu/address-ch/output/clickhouse
5. /build/build_docker/../src/IO/WriteBufferFromS3.cpp:129: DB::WriteBufferFromS3::nextImpl() @ 0x409e98e5 in /home/ubuntu/address-ch/output/clickhouse
6. /build/build_docker/../src/IO/WriteBuffer.h:50: DB::WriteBuffer::next() @ 0x1bf1af90 in /home/ubuntu/address-ch/output/clickhouse
7. /build/build_docker/../src/IO/WriteBuffer.h:73: DB::WriteBuffer::nextIfAtEnd() @ 0x1bf1c058 in /home/ubuntu/address-ch/output/clickhouse
8. /build/build_docker/../src/IO/WriteBuffer.h:88: DB::WriteBuffer::write(char const*, unsigned long) @ 0x1bf1bc8e in /home/ubuntu/address-ch/output/clickhouse
9. /build/build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.cpp:126: DB::ParallelFormattingOutputFormat::collectorThreadFunction(std::__1::shared_ptr<DB::ThreadGroupStatus> const&) @ 0x46729b8d in /home/ubuntu/address-ch/output/clickhouse
10. /build/build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.h:93: DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()::operator()() const @ 0x4627a186 in /home/ubuntu/address-ch/output/clickhouse
11. /build/build_docker/../contrib/libcxx/include/type_traits:3648: decltype(static_cast<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&>(fp)()) std::__1::__invoke_constexpr<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&) @ 0x4627a135 in /home/ubuntu/address-ch/output/clickhouse
12. /build/build_docker/../contrib/libcxx/include/tuple:1595: decltype(auto) std::__1::__apply_tuple_impl<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&, std::__1::__tuple_indices<>) @ 0x4627a0e1 in /home/ubuntu/address-ch/output/clickhouse
13. /build/build_docker/../contrib/libcxx/include/tuple:1604: decltype(auto) std::__1::apply<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&) @ 0x46279ff2 in /home/ubuntu/address-ch/output/clickhouse
14. /build/build_docker/../src/Common/ThreadPool.h:188: ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'()::operator()() @ 0x46279d2e in /home/ubuntu/address-ch/output/clickhouse
15. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'()&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&) @ 0x46279975 in /home/ubuntu/address-ch/output/clickhouse
16. /build/build_docker/../contrib/libcxx/include/__functional/invoke.h:62: void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'()&) @ 0x4627993d in /home/ubuntu/address-ch/output/clickhouse
17. /build/build_docker/../contrib/libcxx/include/__functional/function.h:230: std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'(), void ()>::operator()() @ 0x46279915 in /home/ubuntu/address-ch/output/clickhouse
18. /build/build_docker/../contrib/libcxx/include/__functional/function.h:712: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x462798e2 in /home/ubuntu/address-ch/output/clickhouse
19. /build/build_docker/../contrib/libcxx/include/__functional/function.h:843: std::__1::__function::__policy_func<void ()>::operator()() const @ 0x1bfebcd3 in /home/ubuntu/address-ch/output/clickhouse
20. /build/build_docker/../contrib/libcxx/include/__functional/function.h:1184: std::__1::function<void ()>::operator()() const @ 0x1bfe0655 in /home/ubuntu/address-ch/output/clickhouse
21. /build/build_docker/../src/Common/ThreadPool.cpp:281: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x1c1cd598 in /home/ubuntu/address-ch/output/clickhouse
22. /build/build_docker/../src/Common/ThreadPool.cpp:143: void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const @ 0x1c1de645 in /home/ubuntu/address-ch/output/clickhouse
23. /build/build_docker/../contrib/libcxx/include/type_traits:3640: decltype(static_cast<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&) @ 0x1c1de4d5 in /home/ubuntu/address-ch/output/clickhouse
24. /build/build_docker/../contrib/libcxx/include/thread:283: void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) @ 0x1c1de3c5 in /home/ubuntu/address-ch/output/clickhouse
25. /build/build_docker/../contrib/libcxx/include/thread:293: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) @ 0x1c1dd816 in /home/ubuntu/address-ch/output/clickhouse
26. ? @ 0x7ffff7f76609 in ?
27. clone @ 0x7ffff7e9b163 in ?

2022.06.16 20:04:35.095325 [ 1570360 ] {cf6a186d-a1b3-45c2-a284-658673c0308a} <Error> WriteBufferFromS3: WriteBufferFromS3 is not finalized in destructor. It's a bug
2022.06.16 20:04:35.095941 [ 1428168 ] {} <Trace> BaseDaemon: Received signal -1
2022.06.16 20:04:35.096139 [ 1428168 ] {} <Fatal> BaseDaemon: (version 22.6.1.1, build id: 4083CE5706DE8E43) (from thread 1570360) Terminate called for uncaught exception:
2022.06.16 20:04:35.096308 [ 1428168 ] {} <Fatal> BaseDaemon: Code: 499. DB::Exception: Poco::Exception. Code: 1000, e.code() = 111, Connection refused (version 22.6.1.1). (S3_ERROR), Stack trace (when copying this message, always include the lines below):
2022.06.16 20:04:35.096447 [ 1428168 ] {} <Fatal> BaseDaemon:
2022.06.16 20:04:35.096550 [ 1428168 ] {} <Fatal> BaseDaemon: 0. /build/build_docker/../contrib/libcxx/include/exception:133: std::exception::capture() @ 0x1bf15ce2 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.096664 [ 1428168 ] {} <Fatal> BaseDaemon: 1. /build/build_docker/../contrib/libcxx/include/exception:111: std::exception::exception() @ 0x1bf15cba in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.096786 [ 1428168 ] {} <Fatal> BaseDaemon: 2. /build/build_docker/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x51e1f7e0 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.096916 [ 1428168 ] {} <Fatal> BaseDaemon: 3. /build/build_docker/../src/Common/Exception.cpp:67: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x1c01819e in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097040 [ 1428168 ] {} <Fatal> BaseDaemon: 4. /build/build_docker/../src/IO/WriteBufferFromS3.cpp:225: DB::WriteBufferFromS3::createMultipartUpload() @ 0x409ead8e in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097154 [ 1428168 ] {} <Fatal> BaseDaemon: 5. /build/build_docker/../src/IO/WriteBufferFromS3.cpp:129: DB::WriteBufferFromS3::nextImpl() @ 0x409e98e5 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097269 [ 1428168 ] {} <Fatal> BaseDaemon: 6. /build/build_docker/../src/IO/WriteBuffer.h:50: DB::WriteBuffer::next() @ 0x1bf1af90 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097382 [ 1428168 ] {} <Fatal> BaseDaemon: 7. /build/build_docker/../src/IO/WriteBuffer.h:73: DB::WriteBuffer::nextIfAtEnd() @ 0x1bf1c058 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097502 [ 1428168 ] {} <Fatal> BaseDaemon: 8. /build/build_docker/../src/IO/WriteBuffer.h:88: DB::WriteBuffer::write(char const*, unsigned long) @ 0x1bf1bc8e in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097624 [ 1428168 ] {} <Fatal> BaseDaemon: 9. /build/build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.cpp:126: DB::ParallelFormattingOutputFormat::collectorThreadFunction(std::__1::shared_ptr<DB::ThreadGroupStatus> const&) @ 0x46729b8d in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097748 [ 1428168 ] {} <Fatal> BaseDaemon: 10. /build/build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.h:93: DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()::operator()() const @ 0x4627a186 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.097895 [ 1428168 ] {} <Fatal> BaseDaemon: 11. /build/build_docker/../contrib/libcxx/include/type_traits:3648: decltype(static_cast<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&>(fp)()) std::__1::__invoke_constexpr<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&) @ 0x4627a135 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.098041 [ 1428168 ] {} <Fatal> BaseDaemon: 12. /build/build_docker/../contrib/libcxx/include/tuple:1595: decltype(auto) std::__1::__apply_tuple_impl<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&, std::__1::__tuple_indices<>) @ 0x4627a0e1 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.098231 [ 1428168 ] {} <Fatal> BaseDaemon: 13. /build/build_docker/../contrib/libcxx/include/tuple:1604: decltype(auto) std::__1::apply<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&>(DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()&, std::__1::tuple<>&) @ 0x46279ff2 in /home/ubuntu/address-ch/output/clickhouse
2022.06.16 20:04:35.098382 [ 1428168 ] {} <Fatal> BaseDaemon: 14. /build/build_docker/../src/Common/ThreadPool.h:188: ThreadFromGlobalPool::ThreadFromGlobalPool<DB::ParallelFormattingOutputFormat::ParallelFormattingOutputFormat(DB::ParallelFormattingOutputFormat::Params)::'lambda'()>(DB::ParallelFormattingOutputFormat

Metadata

Metadata

Assignees

Labels

testingSpecial issue with list of bugs found by CI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions