Skip to content

Instantly share code, notes, and snippets.

@johanrhodin
Created November 6, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanrhodin/e932ed7f675a63340270086f752ed364 to your computer and use it in GitHub Desktop.
Save johanrhodin/e932ed7f675a63340270086f752ed364 to your computer and use it in GitHub Desktop.
# num_acceptors.tcp = 1
# num_acceptors.ssl = 1
# tcp_listen_options.backlog = 2
# num_acceptors.tcp = 10
# num_acceptors.ssl = 10
# tcp_listen_options.backlog = 128
log.console = false
log.console.level = info
log.file.level = info
import logging
import pika
import time
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) -35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)
logging.basicConfig(level=logging.ERROR, format=LOG_FORMAT)
while True:
try:
c = pika.BlockingConnection()
ch = c.channel()
# Note: exclusive=False results in unbounded queue count
# and eventual memory alarm
q = ch.queue_declare('', exclusive=True)
print('q: {}'.format(q), flush=True)
ch.queue_bind(queue='', exchange='amq.direct', routing_key='foobar')
ch.close()
c.close()
except pika.exceptions.ChannelClosedByBroker:
print('BOOM')
c.close()
time.sleep(2)
#!/usr/bin/env bash
set -o errexit
source ./venv/bin/activate
set -o nounset
rm -f repro.*.txt
declare -i i=0
for ((i = 0; i < 128; i++))
do
python ./repro.py > repro.$i.txt 2>&1 &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment