From 5f26066f137bc7130b205dba51effa43b42dc0d9 Mon Sep 17 00:00:00 2001
From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>
Date: Tue, 15 Oct 2024 21:31:02 +0200
Subject: do not retry on errors in body as it will create duplicated logs
---
src/plugins/lua/elastic.lua | 30 ++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)
(limited to 'src/plugins/lua/elastic.lua')
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua
index f35de152b..9e3288304 100644
--- a/src/plugins/lua/elastic.lua
+++ b/src/plugins/lua/elastic.lua
@@ -116,7 +116,7 @@ local settings = {
shrink = false,
shards_count = 1,
max_gb_per_shard = 0, -- zero - disabled by default, if enabled - shards_count is ignored
- force_merge = true,
+ force_merge = false,
segments_count = 1,
},
cold = {
@@ -369,7 +369,6 @@ local function elastic_send_data(flush_all, task, cfg, ev_base)
local function http_callback(err, code, body, _)
local push_done = false
- local push_errors = false
if err then
rspamd_logger.errx(log_object, 'cannot send logs to elastic (%s): %s; failed attempts: %s/%s',
push_url, err, buffer['errors'], settings['limits']['max_fail'])
@@ -378,23 +377,10 @@ local function elastic_send_data(flush_all, task, cfg, ev_base)
local res, ucl_err = parser:parse_string(body)
if not ucl_err and res then
local obj = parser:get_object()
- if not obj['errors'] then
- push_done = true
- rspamd_logger.debugm(N, log_object, 'successfully sent payload with %s logs', nlogs_to_send)
- else
- push_errors = true
- for _, value in pairs(obj['items']) do
- if value['index']['status'] >= 400 then
- if value['index']['error'] then
- if value['index']['error']['type'] and value['index']['error']['reason'] then
- rspamd_logger.errx(log_object,
- 'cannot send logs to elastic (%s) due to error: %s status, %s type, due to: %s; failed attempts: %s/%s',
- push_url, value['index']['status'], value['index']['error']['type'], value['index']['error']['reason'],
- buffer['errors'], settings['limits']['max_fail'])
- end
- end
- end
- end
+ push_done = true
+ rspamd_logger.debugm(N, log_object, 'successfully sent payload with %s logs', nlogs_to_send)
+ if obj['errors'] then
+ rspamd_logger.debugm(N, log_object, 'faced errors while pushing logs to elastic (%s): %s', obj['errors'])
end
else
rspamd_logger.errx(log_object,
@@ -412,6 +398,7 @@ local function elastic_send_data(flush_all, task, cfg, ev_base)
buffer['errors'] = 0
upstream:ok()
else
+ upstream:fail()
if buffer['errors'] >= settings['limits']['max_fail'] then
rspamd_logger.errx(log_object, 'failed to send %s log lines, failed attempts: %s/%s, removing failed logs from bugger',
nlogs_to_send, buffer['errors'], settings['limits']['max_fail'])
@@ -420,11 +407,6 @@ local function elastic_send_data(flush_all, task, cfg, ev_base)
else
buffer['errors'] = buffer['errors'] + 1
end
- if push_errors then
- upstream:ok() -- we not assume upstream is failed if it return errors in response body
- else
- upstream:fail()
- end
end
end
--
cgit v1.2.3
pendabot/maven/org.hsqldb-hsqldb-2.7.1
Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/framework
---
title: Overview
order: 1
layout: page
---
[[addons.overview]]
= Overview
In addition to the components, layouts, themes, and data sources built in into
the core Vaadin library, many others are available as add-ons.
link:http://vaadin.com/directory/[Vaadin Directory] provides a rich collection
of add-ons for Vaadin, and you may find others from independent sources. Add-ons
are also one way to share your own components between projects.
== Installing
Installing add-ons from Vaadin Directory is simple, just adding a Maven or an Ivy dependency, or downloading the JAR package and and dropping it in the web library folder of the project.
[[figure.addons.maven.widgetset]]
.Role of the widget set
image::img/addon-architecture.png[width=75%, scaledwidth=80%]
Most add-ons include _widgets_, client-side counterparts of the server-side components used in the Vaadin Java API, as illustrated in <<figure.addons.maven.widgetset>>.
The _widget set_ needs to be compiled into the application widget set.
Adding the dependency in Maven projects and compiling the widget set is described in <<addons-maven#addons.maven, "Using Add-ons in a Maven Project">>.
The section also describes how to use the online compilation and CDN services during development.
For Eclipse projects that use Ivy for dependency management, see <<addons-eclipse#addons.eclipse, "Installing Add-ons in Eclipse with Ivy">>.
You can also download and install add-ons from a ZIP-package, as described in <<addons-downloading#addons.downloading, "Downloading Add-ons from Vaadin Directory">>.
== Add-on Licenses
Add-ons available from Vaadin Directory are distributed under different
licenses, of which some are commercial. While the add-ons can be downloaded
directly, you should note their license and other terms and conditions. Many are
offered under a dual licensing agreement so that they can be used in open source
projects for free, and many have a trial period for closed-source development.
Commercial Vaadin add-ons distributed under the CVAL license require installing
a license key as instructed in
<<dummy/../../../framework/addons/addons-cval#addons.cval, "Installing Commercial Vaadin Add-on Licence">>.
== Feedback and Support
After trying out an add-on, you can give some feedback to the author of the
add-on by rating the add-on with one to five stars and optionally leaving a
comment. Most add-ons also have a discussion forum thread for user feedback and
questions.