Skip to content
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

Improve elastic adapter exception handling #150

Merged

Conversation

JSCU-CNI
Copy link
Contributor

This PR improves exception handling of the Elastic adapter. Currently when an Elasticsearch endpoint is unreachable rdump will stay stuck in a thread. We have added a threading.excepthook to make sure rdump exists with a non-zero status code. Let us know if you prefer a different method of propagating exceptions in rdump. Currently the stdout is a bit noisey, but at least rdump is no longer stuck.

Steps to reproduce:

rdump foo.rec -w elastic+https://invalid-hostname?index=foo

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.87%. Comparing base (941f2cb) to head (c121a97).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
flow/record/adapter/elastic.py 66.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
- Coverage   83.95%   83.87%   -0.09%     
==========================================
  Files          34       34              
  Lines        3466     3478      +12     
==========================================
+ Hits         2910     2917       +7     
- Misses        556      561       +5     
Flag Coverage Δ
unittests 83.87% <72.22%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Schamper Schamper requested a review from yunzheng October 31, 2024 15:37
@JSCU-CNI JSCU-CNI requested a review from yunzheng November 11, 2024 10:30
@yunzheng yunzheng force-pushed the improvement/elastic-adapter-exception-handling branch from fd050fe to c121a97 Compare November 11, 2024 14:43
@yunzheng yunzheng merged commit c482853 into fox-it:main Nov 11, 2024
16 of 20 checks passed
@JSCU-CNI JSCU-CNI deleted the improvement/elastic-adapter-exception-handling branch November 11, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants