Some policies cannot be configured globally: when they are, following the same instruction provided for the logging policy here, they fail to execute. This is not something we document so probably not considered a bug, but due to the reason why they fail, I'd like to make sure they are not caused by an unexpected behaviour in the way we handle contexts.
This was noticed so far on:
1. Batcher policy, producing the error:
2022/02/15 15:48:25 [error] 20#20: *5 lua entry thread aborted: runtime error: ...src/src/apicast/policy/3scale_batcher/3scale_batcher.lua:218: attempt to call method 'publish_backend_auth' (a nil value)
stack traceback:
coroutine 0:
...src/src/apicast/policy/3scale_batcher/3scale_batcher.lua: in function <...src/src/apicast/policy/3scale_batcher/3scale_batcher.lua:184>
2. Upstream connection policy, producing no error or logs at all, just not applying the timeouts
Both the policies above make use of the shared context; for example here (coming from here) and here. I believe the shared context is not working when policies are loaded via the APICAST_ENVIRONMENT and that makes some policies incompatible with the configuration in the global chain.
This commit appears to be related.
- relates to
-
THREESCALE-8149 Enable to configure the Upstream Connection timeouts globally
- To Test (QE)
-
THREESCALE-9320 Conditional policy evaluating incorrectly: second policy in policy chain always triggers
- To Test (QE)
- mentioned on