Tyk rich python plugin and multithreading

Hi,
I have a rich python plugin and I’m puzzled about what I’m seeing.
In the constructor of the middleware I initialize a threading.Thread in the target (method) of which I have a simple loop:

while True:
logger.info(“thread alive…”)
time.sleep(1)

I would expect a continuous stream of “thread alive…” messages in my log. However what I am seeing is a single “thread alive…” message in the logs and then silence. Interestingly, if I send the occasional request through Tyk, I see additional “thread alive…” messages in my logs after that. Is there anything in the Tyk implementation that would explain this strange behavior I’m seeing with threading?

See Python plugins: · Issue #3468 · TykTechnologies/tyk · GitHub

2 Likes

Answered in the above GitHub ticket!