Python GIL error


Getting a Python error when using a plugin.
Happens sometimes, on startup (new instance).

Fatal Python error: drop_gil: GIL is not locked
SIGABRT: abort
PC=0x7f7a35f88c37 m=0
signal arrived during cgo execution

goroutine 417 [syscall, locked to thread]:
runtime.cgocall(0xbe74e0, 0xc42051a068, 0x0)
	/usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc42051a038 sp=0xc420519ff8
	??:0 +0x41 fp=0xc42051a068 sp=0xc42051a038
main.(*PythonDispatcher).HandleMiddlewareCache(0xc42037c500, 0xc4205f2f60, 0xc4203ca910, 0x4b)
	/src/ +0x43 fp=0xc42051a090 sp=0xc42051a068
	/src/ +0x99 fp=0xc42051a0c0 sp=0xc42051a090
	/src/ +0x112e fp=0xc42051a7c0 sp=0xc42051a0c0
main.processSpec(0xc420559d60, 0xc4203a6500, 0x20, 0xc42039f720, 0xc42039f740, 0xc42039f760, 0xc4201bdd40, 0xc4201bdda0, 0xc4203a6500, 0xc4202416e8)
	/src/ +0x8ee0 fp=0xc42051be50 sp=0xc42051a7c0
main.loadApps.func1(0xc4202ffad0, 0xc42002c510, 0xc42039f720, 0xc42039f740, 0xc42039f760, 0xc4201bdd40, 0xc4201bdda0, 0xc4201bde00, 0xc420559d60, 0x20, ...)
	/src/ +0x10a fp=0xc42051bf38 sp=0xc42051be50
	/usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42051bf40 sp=0xc42051bf38
created by main.loadApps
	/src/ +0x4eb

goroutine 1 [semacquire]:
	/usr/local/go/src/runtime/sema.go:47 +0x30
	/usr/local/go/src/sync/waitgroup.go:131 +0x97
main.loadApps(0xc420442f60, 0xc4203a6500)
	/src/ +0x5c8
main.listen(0x14ca0a0, 0xc420148440, 0x14be7a0, 0xc4200100f0)
	/src/ +0xa99
	/src/ +0x182


Hi prashanthviva,

This would be a good question for our plugin expert, cc @matiasb

Kos @ Tyk Support Team


Hi, did you ever experience this issue on hot reloads?

Also, is this a Docker setup or a custom build?



I’ve been able to reproduce this issue, thanks for the report, we’ll be working on a fix.


Thank you. :slight_smile:

Sorry couldn’t reply over the weekend.
Answers to your questions
did you ever experience this issue on hot reloads? : Not sure actually, haven’t tried at hot reloads. But definitely on bootup
is this a Docker setup or a custom build? : Yes, this is a docker build using tyk images.


Thanks for the information, we’re currently testing a patch for this. Will keep you updated.



Hello, just wanted to check if the patch has gone out :slight_smile:


Hi, we have added a patch for it, we’re also working on several enhancements that are related to our Python plugins support.

Please let us know how it goes.


Python bundles get purged after reloading endpoints