Created
November 6, 2020 21:53
-
-
Save johanrhodin/e932ed7f675a63340270086f752ed364 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
venv/ | |
*.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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