You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "goutamadwant (via GitHub)" <gi...@apache.org> on 2026/07/23 00:58:41 UTC
[PR] fix: reevaluate logger meta filters during response phases [apisix]
goutamadwant opened a new pull request, #13727:
URL: https://github.com/apache/apisix/pull/13727
### Description
Logger plugins run an access-phase handler to capture request bodies. This caused `_meta.filter` expressions that reference response variables to be evaluated before those variables were available, with the access-phase result reused during the log phase. Reading `$status` during access also cached `0` in `ctx.var`, which could affect other plugins on the same request.
This change:
- scopes `_meta.filter` result caching to each execution phase, while retaining caching for repeated callbacks within the same phase
- prevents `$status` from being cached because its value changes after the response status is determined
- adds regression coverage for response-phase filters and cross-plugin status isolation
#### Which issue(s) this PR fixes:
Fixes #13724
### Tests
- `prove -I. -r t/core/ctx2.t`
- `prove -I. -r t/plugin/file-logger3.t`
- `prove -I. -r t/plugin/plugin.t`
- `prove -I. -r t/plugin/file-logger.t t/plugin/file-logger2.t`
- `./utils/lj-releng apisix/plugin.lua apisix/core/ctx.lua`
The issue scenarios were also reproduced on APISIX 3.17.0 and verified against the patched source. Gateway-generated 404 responses are filtered as configured, while upstream 200 and 404 responses are logged with their actual status values.
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change (Not applicable: this restores existing behavior without changing configuration or public APIs.)
- [x] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: reevaluate logger meta filters during response phases [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13727:
URL: https://github.com/apache/apisix/pull/13727#issuecomment-5794205249
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org