Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

I get Intermittent hangs of up to 10 minutes when connecting to DB2 server.

Open
#1,073 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cryptography, python

Research direction

Start with the reproducible command in /usr/local/lib64/python3.12/site-packages/clidriver/bin using db2cli, then review the db2trc performance output around SQLDriverConnectW, cryptDHInit, and cryptContextRealInit. Compare immediate and ten-minute connection attempts on the reported RHEL, ibm_db, and Db2 versions; done means identifying the cause of the intermittent CPU-heavy hang and documenting or implementing a verified resolution.

Written by the indexing model from the issue text.

Description

  • Operating System Name:
$ cat /etc/*release
NAME="Red Hat Enterprise Linux"
VERSION="9.8 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.8"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.8 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://issues.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.8
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.8"
Red Hat Enterprise Linux release 9.8 (Plow)
Red Hat Enterprise Linux release 9.8 (Plow)
  • db2level output from clidriver if in use:
$ ./db2level 
DB21085I  This instance or install (instance name, where applicable: "*") uses 
"64" bits and DB2 code release "SQL11059" with level identifier "060A010F".
Informational tokens are "DB2 v11.5.9.0", "special_50315", 
"DYN2410311831AMD64_50315", and Fix Pack "0".
Product is installed at "..".
  • Target Db2 Server Version:
IBM Db2 operator installed in Openshift

Operator CSV: db2u-operator.v120104.0.0
DB2 Cluster CR 
status:
  version: s12.1.4.0
  • Python Version:
$ python3 --version
Python 3.12.13
  • ibm_db version:
$ pip3 list
...
ibm_db                       3.2.8
  • For non-Windows, output of below commands:
    uname
    uname -m
$ uname
Linux
sh-5.1$   uname -m
x86_64
sh-5.1$   uname -a
Linux credential-entitymgr-jdbccfg-5bbdb9df5d-j5krh 5.14.0-570.122.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 12 06:17:09 EDT 2026 x86_64 x86_64 x86_64 GNU/Linux
  • Value of below environment variables if set:
    IBM_DB_HOME:
    PATH:
    LIB/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH:
sh-5.1$ echo $IBM_DB_HOME

$ echo $PATH
/opt/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh-5.1$ echo $LIB

sh-5.1$ echo $LD_LIBRARY_PATH
/lib64:/usr/lib64:/usr/local/lib:/opt/ansible/lib:
sh-5.1$ echo $DYLD_LIBRARY_PATH

sh-5.1$
  • Test script to reproduce the problem.
The connection has been running as part on an ansible playbook/task

Eventually through debugging I was able to reproduce the hang using the DB2 CLI

cd /usr/local/lib64/python3.12/site-packages/clidriver/bin
./db2cli execsql -connstring "DATABASE=BLUDB;HOSTNAME=c-mas-credential-main-manage-db2u-engn-svc.db2u.svc;PORT=50001;PROTOCOL=TCPIP;UID=db2inst1;PWD=XXXXXXX;SECURITY=ssl;SSLServerCertificate=/tmp/jdbc.pem;"
…

Sometimes this completes instantly, sometimes it hangs for around 10 minutes

**

**

  1. Can be reproduced using the DB2CLI command above, sometimes this completes instantly, sometimes it hangs for around 10 minutes

Observations and diagnostics
The process is taking 100% CPU during the hang, it’s not just idle.

I saw similar issues reported here

https://github.com/ibmdb/python-ibmdb/issues/946
https://github.com/ibmdb/python-ibmdb/issues/763
https://github.com/ibmdb/python-ibmdb/issues/630

So I ran db2trc and see a lot of time spent in SQLDriverConnectW and cryptDHInit, cryptContextRealInit:

$ ./db2trc on -perfcount -t
$ ./db2trc dmp /tmp/perf.dmp
$ ./db2trc perffmt /tmp/perf.dmp /tmp/perf.fmt
$ sort -k 2 /tmp/perf.fmt

     1         11.288255000 sqljrLookupAddressAndConnect
     2         17.446558000 sqljrDrdaArAuthenticate
     1        341.828108000 cryptContextRealInit
     1        341.828131000 cryptDHInit
     1        345.503134000 sqlexSlcServerEncryptAccsec
     2        345.503246000 sqlexSlcServerEncryptAuthenticate
     1        362.950027000 sqlexAppAuthenticate
     1        362.950299000 sqljrDrdaArConnect
     1        362.950324000 sqleUCdrdaARinit
     1        362.969425000 sqleUCappConnect
     1        362.970356000 CLI_sqlConnect
     1        362.970449000 CLI_sqlConnect
     1        362.970670000 SQLConnect2
     1        362.970684000 SQLConnect2
     1        362.971202000 SQLDriverConnect2
     1        362.971215000 SQLDriverConnect2
     1        362.971380000 SQLDriverConnectW
     1        362.971440000 SQLDriverConnectW

see the attached perf.dmp and perf.out files.

Dominant language
Python
Stars
333
Forks
203
Avg merge
12d 1h
Merged PRs (30d)
3

Getting set up

  • No Dockerfile or Docker Compose file
  • No pull request template
  • Read the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.