Skip to content

Commit 87790b7

Browse files
Merge branch 'master' into insertion-table
2 parents 995ca73 + 7fb41e6 commit 87790b7

File tree

567 files changed

+13110
-5245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

567 files changed

+13110
-5245
lines changed

.github/workflows/create_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ jobs:
135135
./utils/list-versions/update-docker-version.sh
136136
echo "Generate ChangeLog"
137137
export CI=1
138+
docker pull clickhouse/style-test:latest
138139
docker run -u "${UID}:${GID}" -e PYTHONUNBUFFERED=1 -e CI=1 --network=host \
139140
--volume=".:/wd" --workdir="/wd" \
140-
clickhouse/style-test \
141+
clickhouse/style-test:latest \
141142
./tests/ci/changelog.py -v --debug-helpers \
142143
--gh-user-or-token ${{ secrets.ROBOT_CLICKHOUSE_COMMIT_TOKEN }} \
143144
--jobs=5 \

CHANGELOG.md

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ option(OMIT_HEAVY_DEBUG_SYMBOLS
204204
${OMIT_HEAVY_DEBUG_SYMBOLS_DEFAULT})
205205

206206
option(BUILD_STANDALONE_KEEPER "Build keeper as small standalone binary" OFF)
207-
if (NOT BUILD_STANDALONE_KEEPER)
208-
option(CREATE_KEEPER_SYMLINK "Create symlink for clickhouse-keeper to main server binary" ON)
209-
else ()
210-
option(CREATE_KEEPER_SYMLINK "Create symlink for clickhouse-keeper to main server binary" OFF)
211-
endif ()
212207

213208
# Create BuildID when using lld. For other linkers it is created by default.
214209
# (NOTE: LINKER_NAME can be either path or name, and in different variants)

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ Please feel free to reach out to tyler `<at>` clickhouse `<dot>` com.
4747
You can also peruse [ClickHouse Events](https://clickhouse.com/company/news-events) for a list of all upcoming trainings, meetups, speaking engagements, etc.
4848

4949
Upcoming meetups
50-
* [Tokyo Meetup with Confluent](https://www.meetup.com/clickhouse-tokyo-user-group/events/306832118/) - April 15, 2025
51-
* [Kuala Lumper Meetup with CNCF](https://www.meetup.com/clickhouse-malaysia-meetup-group/events/306697678/) - April 16, 2025
5250
* [Jakarta Meetup with AWS](https://www.meetup.com/clickhouse-indonesia-user-group/events/306973747/) - April 22, 2025
5351
* [Denver Meetup](https://www.meetup.com/clickhouse-denver-user-group/events/306934991/) - April 23, 2025
5452
* [Austin Meetup](https://www.meetup.com/clickhouse-austin-user-group/events/307289908) - May 13, 2025
5553
* [London Meetup](https://www.meetup.com/clickhouse-london-user-group/events/306047172/) - May 14, 2025
5654
* [Istanbul Meetup](https://www.meetup.com/clickhouse-turkiye-meetup-group/events/306978337/) - May 15, 2025
55+
* [Shenzhen Meetup](hhttps://www.huodongxing.com/event/7803892350511) - May 17, 2025
5756

5857
Recent meetups
58+
* [Kuala Lumper Meetup with CNCF](https://www.meetup.com/clickhouse-malaysia-meetup-group/events/306697678/) - April 16, 2025
59+
* [Tokyo Meetup with Confluent](https://www.meetup.com/clickhouse-tokyo-user-group/events/306832118/) - April 15, 2025
5960
* [Ho Chi Minh Meetup with AWS & Infinite Lambda](https://www.meetup.com/clickhouse-vietnam-meetup-group/events/306810105/) - April 12, 2025
6061
* [Oslo Meetup](https://www.meetup.com/open-source-real-time-data-warehouse-real-time-analytics/events/306414327/) - April 8, 2025
6162
* [Sydney Meetup](https://www.meetup.com/clickhouse-australia-user-group/events/306549810/) - April 1, 2025

base/poco/NetSSL_OpenSSL/include/Poco/Net/SecureSocketImpl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,21 @@ namespace Net
236236
/// to be able to re-use it again.
237237

238238
private:
239+
using MutexT = Poco::FastMutex;
240+
using LockT = MutexT::ScopedLock;
241+
using UnLockT = Poco::ScopedLockWithUnlock<MutexT>;
242+
239243
SecureSocketImpl(const SecureSocketImpl &);
240244
SecureSocketImpl & operator=(const SecureSocketImpl &);
241245

242246
mutable std::recursive_mutex _mutex;
243-
SSL * _pSSL; // GUARDED_BY _mutex
247+
std::atomic<SSL *> _pSSL;
244248
Poco::AutoPtr<SocketImpl> _pSocket;
245249
Context::Ptr _pContext;
246250
bool _needHandshake;
247251
std::string _peerHostName;
248252
Session::Ptr _pSession;
253+
mutable MutexT _ssl_mutex;
249254

250255
friend class SecureStreamSocketImpl;
251256

base/poco/NetSSL_OpenSSL/src/SecureSocketImpl.cpp

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ void SecureSocketImpl::acceptSSL()
103103
std::lock_guard<std::recursive_mutex> lock(_mutex);
104104
poco_assert (!_pSSL);
105105

106+
LockT l(_ssl_mutex);
107+
106108
BIO* pBIO = BIO_new(BIO_s_socket());
107109
if (!pBIO) throw SSLException("Cannot create BIO object");
108110
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
@@ -169,6 +171,8 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
169171
poco_assert (!_pSSL);
170172
poco_assert (_pSocket->initialized());
171173

174+
LockT l(_ssl_mutex);
175+
172176
BIO* pBIO = BIO_new(BIO_s_socket());
173177
if (!pBIO) throw SSLException("Cannot create SSL BIO object");
174178
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
@@ -246,6 +250,8 @@ void SecureSocketImpl::shutdown()
246250
std::lock_guard<std::recursive_mutex> lock(_mutex);
247251
if (_pSSL)
248252
{
253+
UnLockT l(_ssl_mutex);
254+
249255
// Don't shut down the socket more than once.
250256
int shutdownState = SSL_get_shutdown(_pSSL);
251257
bool shutdownSent = (shutdownState & SSL_SENT_SHUTDOWN) == SSL_SENT_SHUTDOWN;
@@ -260,6 +266,7 @@ void SecureSocketImpl::shutdown()
260266
// done with it.
261267
int rc = SSL_shutdown(_pSSL);
262268
if (rc < 0) handleError(rc);
269+
l.unlock();
263270
if (_pSocket->getBlocking())
264271
{
265272
_pSocket->shutdown();
@@ -290,6 +297,9 @@ int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
290297
poco_check_ptr (_pSSL);
291298

292299
int rc;
300+
301+
LockT l(_ssl_mutex);
302+
293303
if (_needHandshake)
294304
{
295305
rc = completeHandshake();
@@ -331,6 +341,8 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
331341
poco_assert (_pSocket->initialized());
332342
poco_check_ptr (_pSSL);
333343

344+
LockT l(_ssl_mutex);
345+
334346
/// Special case: just check that we can read from socket
335347
if ((flags & MSG_DONTWAIT) && (flags & MSG_PEEK))
336348
return _pSocket->receiveBytes(buffer, length, flags);
@@ -368,6 +380,8 @@ int SecureSocketImpl::available() const
368380
std::lock_guard<std::recursive_mutex> lock(_mutex);
369381
poco_check_ptr (_pSSL);
370382

383+
LockT l(_ssl_mutex);
384+
371385
return SSL_pending(_pSSL);
372386
}
373387

@@ -464,10 +478,20 @@ bool SecureSocketImpl::isLocalHost(const std::string& hostName)
464478
X509* SecureSocketImpl::peerCertificate() const
465479
{
466480
std::lock_guard<std::recursive_mutex> lock(_mutex);
481+
LockT l(_ssl_mutex);
482+
483+
X509* pCert = nullptr;
484+
467485
if (_pSSL)
468-
return SSL_get1_peer_certificate(_pSSL);
469-
else
470-
return 0;
486+
{
487+
pCert = ::SSL_get_peer_certificate(_pSSL);
488+
489+
if (X509_V_OK != SSL_get_verify_result(_pSSL))
490+
throw CertificateValidationException("SecureSocketImpl::peerCertificate(): "
491+
"Certificate verification error " + Utility::getLastError());
492+
}
493+
494+
return pCert;
471495
}
472496

473497
Poco::Timespan SecureSocketImpl::getMaxTimeoutOrLimit()
@@ -608,6 +632,8 @@ void SecureSocketImpl::reset()
608632
close();
609633
if (_pSSL)
610634
{
635+
LockT l(_ssl_mutex);
636+
611637
SSL_free(_pSSL);
612638
_pSSL = nullptr;
613639
}
@@ -652,9 +678,12 @@ bool SecureSocketImpl::sessionWasReused()
652678
{
653679
std::lock_guard<std::recursive_mutex> lock(_mutex);
654680
if (_pSSL)
655-
return SSL_session_reused(_pSSL) != 0;
656-
else
657-
return false;
681+
{
682+
LockT l(_ssl_mutex);
683+
return ::SSL_session_reused(_pSSL) != 0;
684+
}
685+
686+
return false;
658687
}
659688

660689
void SecureSocketImpl::setBlocking(bool flag)

ci/defs/job_configs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ class JobConfigs:
281281
RunnerLabels.BUILDER_ARM, # fuzzers
282282
],
283283
)
284+
builds_for_tests = [b.name for b in build_jobs] + [tidy_build_jobs[0]]
284285
install_check_jobs = Job.Config(
285286
name=JobNames.INSTALL_TEST,
286287
runs_on=["..."],

ci/docker/style-test/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ yamllint==1.26.3
33
codespell==2.2.1
44
mypy==1.15.0
55
pylint==3.1.0
6+
# required for change log generation:
7+
tqdm==4.67.1
8+
thefuzz==0.22.1
9+
PyGitHub==2.6.1
10+
boto3==1.37.38

ci/jobs/build_clickhouse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def main():
156156
name="Cmake configuration",
157157
command=cmake_cmd,
158158
workdir=build_dir,
159+
with_log=True,
159160
)
160161
)
161162
res = results[-1].is_ok()
@@ -176,6 +177,7 @@ def main():
176177
name="Build ClickHouse",
177178
command=f"ninja {targets}",
178179
workdir=build_dir,
180+
with_log=True,
179181
)
180182
)
181183
run_shell("sccache stats", "sccache --show-stats")
@@ -206,6 +208,7 @@ def main():
206208
f"cd {Utils.cwd()}/packages/ && OUTPUT_DIR={temp_dir} BUILD_TYPE={BUILD_TYPE_TO_DEB_PACKAGE_TYPE[build_type]} VERSION_STRING={version_dict['string']} DEB_ARCH={deb_arch} ./build --deb {'--rpm --tgz' if 'release' in build_type else ''}",
207209
],
208210
workdir=build_dir,
211+
with_log=True,
209212
)
210213
)
211214
res = results[-1].is_ok()

ci/jobs/clickbench.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def start():
3636
Result.from_commands_run(
3737
name="Start ClickHouse",
3838
command=[start, log_export_config, setup_logs_replication],
39+
with_log=True,
3940
)
4041
)
4142
res = results[-1].is_ok()

0 commit comments

Comments
 (0)