membphis commented on code in PR #12338:
URL: https://github.com/apache/apisix/pull/12338#discussion_r2157937064
##########
apisix/utils/batch-processor-manager.lua:
##########
@@ -85,7 +86,20 @@ do
end
-function _M:add_entry(conf, entry)
+local function total_processed_entries(self)
+ local processed_entries = 0
+ for _, log_buffer in pairs(self.buffers) do
Review Comment:
I am little worried it will cause bad performance
need a benchmark to confirm it
##########
apisix/utils/batch-processor-manager.lua:
##########
@@ -94,11 +108,17 @@ function _M:add_entry(conf, entry)
end
log_buffer:push(entry)
+ self.total_pushed_entries = self.total_pushed_entries + 1
return true
end
-function _M:add_entry_to_new_processor(conf, entry, ctx, func)
+function _M:add_entry_to_new_processor(conf, entry, ctx, func,
max_pending_entries)
+ if max_pending_entries and
+ self.total_pushed_entries - total_processed_entries(self) >
max_pending_entries then
+ core.log.error("max pending entries limit exceeded. discarding entry")
Review Comment:
need to print more useful information, eg: max_pending_entries,
`self.total_pushed_entries - total_processed_entries(self)`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]