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
main._Cfunc_Python_HandleMiddlewareCache(0x33034a0)
	??:0 +0x41 fp=0xc42051a068 sp=0xc42051a038
main.(*PythonDispatcher).HandleMiddlewareCache(0xc42037c500, 0xc4205f2f60, 0xc4203ca910, 0x4b)
	/src/github.com/TykTechnologies/tyk/coprocess_python.go:223 +0x43 fp=0xc42051a090 sp=0xc42051a068
main.(*Bundle).AddToSpec(0xc4205f2f20)
	/src/github.com/TykTechnologies/tyk/coprocess_bundle.go:109 +0x99 fp=0xc42051a0c0 sp=0xc42051a090
main.loadBundle(0xc420559d60)
	/src/github.com/TykTechnologies/tyk/coprocess_bundle.go:321 +0x112e fp=0xc42051a7c0 sp=0xc42051a0c0
main.processSpec(0xc420559d60, 0xc4203a6500, 0x20, 0xc42039f720, 0xc42039f740, 0xc42039f760, 0xc4201bdd40, 0xc4201bdda0, 0xc4203a6500, 0xc4202416e8)
	/src/github.com/TykTechnologies/tyk/api_loader.go:216 +0x8ee0 fp=0xc42051be50 sp=0xc42051a7c0
main.loadApps.func1(0xc4202ffad0, 0xc42002c510, 0xc42039f720, 0xc42039f740, 0xc42039f760, 0xc4201bdd40, 0xc4201bdda0, 0xc4201bde00, 0xc420559d60, 0x20, ...)
	/src/github.com/TykTechnologies/tyk/api_loader.go:627 +0x10a fp=0xc42051bf38 sp=0xc42051be50
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2086 +0x1 fp=0xc42051bf40 sp=0xc42051bf38
created by main.loadApps
	/src/github.com/TykTechnologies/tyk/api_loader.go:630 +0x4eb

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc4202ffadc)
	/usr/local/go/src/runtime/sema.go:47 +0x30
sync.(*WaitGroup).Wait(0xc4202ffad0)
	/usr/local/go/src/sync/waitgroup.go:131 +0x97
main.loadApps(0xc420442f60, 0xc4203a6500)
	/src/github.com/TykTechnologies/tyk/api_loader.go:642 +0x5c8
main.listen(0x14ca0a0, 0xc420148440, 0x14be7a0, 0xc4200100f0)
	/src/github.com/TykTechnologies/tyk/main.go:1357 +0xa99
main.main()
	/src/github.com/TykTechnologies/tyk/main.go:1109 +0x182

Hi prashanthviva,

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

Thanks,
Kos @ Tyk Support Team

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

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

Best.

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.

Best.

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.

Best.