-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[azure-eventhub input] Switch the run EPH run mode to non-blocking #34075
[azure-eventhub input] Switch the run EPH run mode to non-blocking #34075
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
7bbe6a3
to
668edc5
Compare
021502b
to
02ea2b1
Compare
/test |
02ea2b1
to
510eae6
Compare
SonarQube thinks fixing this duplicated code it’s on me, even if I did not change this file in the PR ¯\_(ツ)_/¯
a4a972c
to
cbfe35c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test data forwarding to Elasticsearch but I tested autoreloading configuration (played with platformlogs
configs).
At each save the new content was picked up and used to configure the input, with restarts in appropriate cases. I can confirm the stop/start sequence is run:
[...] Starting reload procedure, current runners: 1 [...]
[...] Start list: 1, Stop list: 1 [...]
[...] Stopping runner: azure (platformlogs) [...]
[...] azure-eventhub input worker has started. [...]
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
That's my first contact with azure-eventhub
, but looks good.
…34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading. (cherry picked from commit 8f0db84) # Conflicts: # x-pack/libbeat/management/generate_test.go
…34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading. (cherry picked from commit 8f0db84) # Conflicts: # x-pack/libbeat/management/generate_test.go
…34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading. (cherry picked from commit 8f0db84)
…34075) (#34101) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading. (cherry picked from commit 8f0db84) Co-authored-by: Maurizio Branca <[email protected]>
…mode to non-blocking (#34100) * [azure-eventhub input] Switch the run EPH run mode to non-blocking (#34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading. (cherry picked from commit 8f0db84) Co-authored-by: Maurizio Branca <[email protected]>
…mode to non-blocking (#34099) * [azure-eventhub input] Switch the run EPH run mode to non-blocking (#34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading.
…34075) * Start EPH as non-blocking With this change, the first call to the input Start() method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls the Stop() method to tear it down for live reloading.
What does this PR do?
Update the
azure-eventhub
input to switch the run mode of the Event Processor Host (EPH) from blocking to non-blocking.With the changes in the PR, the first call to the input
Start()
method will set up and start the EPH worker in a non-blocking fashion. The EPH worker will continue until the Filebeat calls theStop()
method to tear it down for live reloading.Why is it important?
Since 8.3.3, the input Runner changed its behavior during the live reload:
< 8.3.3
: the input Runner stops the old input and starts a new input without waiting for the stop to complete.>= 8.3.3
: the input Runner stops the old input and waits for theStop()
method to complete before starting a new one.Unfortunately, if we run Start() with EPH in a blocking mode, the method will not return because it will continue waiting for an
os.Signal
that will never come.If the EPH's
Start()
method does not end, the EPHsync.WaitGroup
will continue waiting forever.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
1. Enable live reload
Edit the
filebeat.yml
file and update the "Filebeat modules" like this one:2. Enable the azure module
Copy the
azure.yml.disabled
file intoazure.yml
and set up one of the existing inputs.For example:
3. Testing
Start Filebeat and make sure the platform logs are created in Elasticsearch.
Make some changes to the
azure.yml
. For example, try to add/remove/change thetags
and within 10 seconds Filebeat will trigger a configuration reload.Related issues