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

RHIROS-1117 - Refactor processors #321

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

upadhyeammit
Copy link
Contributor

PR Title πŸ’₯

Why do we need this change? πŸ’­

Please include the context of this change here.

Documentation update? πŸ“

  • Yes
  • No

Security Checklist πŸ”’

Upon raising this PR please go through RedHatInsights/secure-coding-checklist

πŸ’‚β€β™‚οΈ Checklist 🎯

  • Bugfix
  • New Feature
  • Refactor
  • Unittests Added
  • DRY code
  • Dependency Added
  • DB Migration Added

Additional πŸ“£

Feel free to add any other relevant details such as links, notes, screenshots, here.

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 43.01% and project coverage change: +0.73 πŸŽ‰

Comparison is base (6651b74) 72.97% compared to head (b37f8b6) 73.70%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   72.97%   73.70%   +0.73%     
==========================================
  Files          27       28       +1     
  Lines        1321     1316       -5     
==========================================
+ Hits          964      970       +6     
+ Misses        357      346      -11     
Flag Coverage Ξ”
unittests 73.70% <43.01%> (+0.73%) ⬆️

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

Impacted Files Coverage Ξ”
ros/processor/main.py 0.00% <0.00%> (ΓΈ)
ros/processor/inventory_events_consumer.py 57.57% <30.00%> (+8.68%) ⬆️
ros/processor/ros_consumer.py 44.73% <44.73%> (ΓΈ)
ros/processor/insights_engine_consumer.py 81.39% <63.63%> (+10.64%) ⬆️

β˜” View full report in Codecov by Sentry.
πŸ“’ Do you have feedback about the report comment? Let us know in this issue.

@r14chandra
Copy link
Contributor

/retest

finally:
self.consumer.commit()
LOG.warning("Stopping inventory consumer")
self.consumer.close()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @patilsuraj767 -
In inventory related processor, we are explicitly closing the consumer whereas in engine related processor, we are not closing it.
Could you share few inputs & any scenario you can think of might cause issue when we close on engine side too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closing the consumer connection is good practice but I guess not mandatory. Basically as per me closing the connection just speed up the process. Example - Consider there is a pod consuming msgs from Kafka but suddenly pod dies for some reason without closing the connection and then OpenShift spin up the new pod but new pod will not be quickly able to connect to Kafka topic till the timeout (30s default) happens and Kafka broker terminates the previous connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it better then! I would close the connections for both! Thanks for inputs!

@upadhyeammit
Copy link
Contributor Author

I have rebased this! request to review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants