Skip to content

Commit eb07ef3

Browse files
committed
feat: show libcurl version
1 parent 4c1ca73 commit eb07ef3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ _PG_init(void)
421421
worker.bgw_start_time = BgWorkerStart_RecoveryFinished;
422422
snprintf(worker.bgw_library_name, BGW_MAXLEN, "pg_net");
423423
snprintf(worker.bgw_function_name, BGW_MAXLEN, "worker_main");
424-
snprintf(worker.bgw_name, BGW_MAXLEN, "pg_net " EXTVERSION " worker");
424+
snprintf(worker.bgw_name, BGW_MAXLEN, "pg_net " EXTVERSION " worker using %s", curl_version());
425425
worker.bgw_restart_time = 1;
426426
worker.bgw_main_arg = (Datum) 0;
427427
worker.bgw_notify_pid = 0;

test/test_worker_version.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from sqlalchemy import text
2+
import pytest
3+
import time
4+
5+
def test_showing_worker_libcurl_version(sess):
6+
"""the backend type shows the worker version and the libcurl version"""
7+
8+
# wait for worker to start in case another test restarted it
9+
time.sleep(1)
10+
11+
(result,) = sess.execute(
12+
"""
13+
select backend_type like 'pg_net % worker using libcurl%' from pg_stat_activity where backend_type like '%pg_net%';
14+
"""
15+
).fetchone()
16+
assert result is True

0 commit comments

Comments
 (0)