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

Fix Python Logger and Pool #868

Merged
merged 4 commits into from
Oct 16, 2023
Merged

Fix Python Logger and Pool #868

merged 4 commits into from
Oct 16, 2023

Conversation

ryanmelt
Copy link
Member

No description provided.

@ryanmelt ryanmelt requested a review from jmthomas October 14, 2023 03:26
@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (87c2d06) 72.66% compared to head (a6a8f3c) 72.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #868      +/-   ##
==========================================
- Coverage   72.66%   72.66%   -0.01%     
==========================================
  Files         611      611              
  Lines       42273    42263      -10     
  Branches      870      870              
==========================================
- Hits        30719    30711       -8     
+ Misses      11461    11459       -2     
  Partials       93       93              
Flag Coverage Δ
ruby-api 48.44% <ø> (ø)
ruby-backend 80.31% <ø> (ø)

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

Files Coverage Δ
openc3/python/openc3/packets/packet.py 88.83% <ø> (-0.02%) ⬇️
openc3/python/openc3/system/system.py 77.63% <ø> (+1.00%) ⬆️
openc3/python/openc3/utilities/connection_pool.py 95.00% <ø> (-0.46%) ⬇️
openc3/python/openc3/utilities/logger.py 85.71% <ø> (+0.14%) ⬆️

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

try:
yield item
finally:
self.pool.put(item)
Copy link
Member

Choose a reason for hiding this comment

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

Was this losing items if the yield raised an exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know where it was losing items, but it definitely was. This was eventually causing the decom lockup because it was waiting forever for a redis instance to be available.

or func == "my_instance"
or func == "scope"
or func == "__dict__"
):
Copy link
Member

Choose a reason for hiding this comment

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

Would like to see this as an array of values with a comment. Then you can do if func in ATTR_NAMES: or whatever you call it. Comment on where these names come from.

Same for the next three examples.

@jmthomas
Copy link
Member

Looks like this really broke the python unit tests. I think it has to do with the NO_STORE variable and how that is getting set and used.

@ryanmelt
Copy link
Member Author

The NO_STORE logic was completely wrong before this fix. INST2 wasn't printing any log messages.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jmthomas jmthomas merged commit e9b0d36 into main Oct 16, 2023
22 of 25 checks passed
@jmthomas jmthomas deleted the fix_pool_and_logger branch October 16, 2023 17:17
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