Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1629195 Details for
Bug 1755154
postgresql-libs - Deadlocks occur when using SSL in a multi-threaded environment
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
A modified version of the reproducer Python 2 script
reproducer.py (text/x-python), 1.70 KB, created by
Matt Prahl
on 2019-10-25 13:58:14 UTC
(
hide
)
Description:
A modified version of the reproducer Python 2 script
Filename:
MIME Type:
Creator:
Matt Prahl
Created:
2019-10-25 13:58:14 UTC
Size:
1.70 KB
patch
obsolete
>#!/usr/bin/env python >import ssl >import sys >import time >import threading >import requests > >import psycopg2 > >DB_HOST = 'INSERT HERE' >DB_USER = 'INSERT HERE' >DB_NAME = 'INSERT HERE' >DB_PASSWORD = 'INSERT HERE' > >HTTPS_URL = 'https://google.com' >NUM_HTTPS_THREADS = 10 > > >def connect(): > conn = psycopg2.connect( > host=DB_HOST, user=DB_USER, password=DB_PASSWORD, > database=DB_NAME, sslmode='require') > return conn > > >class Worker(threading.Thread): > > def __init__(self): > super(Worker, self).__init__() > self._stop = threading.Event() > > def stop(self): > self._stop.set() > > def stopped(self): > return self._stop.isSet() > > def run(self): > i = 0 > while not self.stopped(): > i += 1 > self.do_work(i) > > >class Libpq(Worker): > > def do_work(self, i): > conn = connect() > cur = conn.cursor() > cur.execute('SELECT 1') > cur.close() > conn.close() > if not i % 10: > print '+' > > >class HTTPS(Worker): > > def do_work(self, i): > r = requests.get(HTTPS_URL, allow_redirects=False, verify=False) > if not i % 10: > print '=' > > >def main(): > # make sure libpq has set its locking callbacks > conn = connect() > cur = conn.cursor() > cur.execute('SELECT 1') > cur.close() > conn.close() > > threads = [Libpq()] > threads += [HTTPS() for _ in range(NUM_HTTPS_THREADS)] > > print 'starting worker threads' > > try: > for t in threads: > t.start() > while True: > time.sleep(1000) > except KeyboardInterrupt: > for t in threads: > t.stop() > > for t in threads: > t.join() > > >if __name__ == "__main__": > sys.exit(main()) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1755154
:
1618713
|
1629194
| 1629195