Kong / go-pdk

Write Kong plugins in Go! 🦍
https://pkg.go.dev/github.com/Kong/go-pdk
Apache License 2.0
144 stars 48 forks source link

fix(test): fix hanging by channel for kong.response.exit #170

Closed jakeslee closed 4 months ago

jakeslee commented 6 months ago

Fix #169.

Channel stateChange isn't buffered channel. The e.Finish() method writes the channel, but the consumer is in the same go routine. So it causes a dead lock.

Changing the channel to buffered can solve the issue.

CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.

nowNick commented 5 months ago

I think this is good to go, but @gszr could you take another look?

winslowdibona commented 4 months ago

@gszr @nowNick I've added these changes as well as the requested test to my PR (#174) that addresses the hanging channel issue and adds support for shared ctx handlers in the test utility.

In the interest of getting this breaking change fixed could we look at moving forward with my PR? Would you rather I break the PR into two separate PRs (one for hanging channel issue, one for shared ctx handlers)?

I'm only persistent in bringing this up because in its current state, the testing utility does not work and prevents developers from moving forward with the tool.

gszr commented 4 months ago

Closing this in favor of #174.