Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(request-transformer): thread safety #10539

Merged
merged 2 commits into from
Mar 23, 2023

Conversation

samugi
Copy link
Member

@samugi samugi commented Mar 22, 2023

Summary

This is a porting of EE/4816

Make the template environment thread safe by scoping it on the request rather than on the module level.

Checklist

Full changelog

  • [Implement ...]

Issue reference

KAG-933

@samugi
Copy link
Member Author

samugi commented Mar 22, 2023

@ms2008 what do you think about this test?

@samugi samugi force-pushed the fix/request-transformer-thread-safety branch from f7c2575 to 36ddefc Compare March 22, 2023 16:31
@samugi samugi force-pushed the fix/request-transformer-thread-safety branch 2 times, most recently from c31bfc7 to 67927af Compare March 22, 2023 21:11
@samugi samugi marked this pull request as draft March 23, 2023 07:19
samugi added 2 commits March 23, 2023 09:01
Make the template environment thread safe by scoping it to the request
rather than the module

This was problematic because reading the body (during body
transformation) results in yielding.
@samugi samugi force-pushed the fix/request-transformer-thread-safety branch from 67927af to aea629a Compare March 23, 2023 08:01
@samugi samugi marked this pull request as ready for review March 23, 2023 08:02
Copy link
Contributor

@ms2008 ms2008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!The test case is fantastic - the code looks clean and highly effective!

@kikito kikito merged commit d6e1d35 into master Mar 23, 2023
@kikito kikito deleted the fix/request-transformer-thread-safety branch March 23, 2023 10:44
lhanjian pushed a commit that referenced this pull request Dec 23, 2024
* tests(rbac): fix 01-rbac/01-rbac_spec.lua (#10463)

* db(dao/workspaces): check kong.conf in select_by_name

* fix 01-rbac/01-rbac_spec.lua

* tests(keyring): pagesize must not be less than 2 (#10462)

* (keyring): pagesize must not be less than 2

* comments

* math.max

* fix(*): remove hardcoded size 1000 from :each interface call (#10480)

* set ws_id nil in tests (#10488)

* fix(incremental sync): fix bug that CP generates entity without expanding foreigns (#10526)

* fix(incremental sync): fix bug that CP generates entity without expanding foreigns

* added XXX EE only

* chore: fallback workspace (#10469)

* remove field_ws_id

* Revert "remove field_ws_id"

This reverts commit 880f5dac107364c7df9800b910631ce1c94451b2.

---------

Co-authored-by: Xiaochen Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants