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

Fixes #3028

Merged
merged 11 commits into from
Feb 19, 2025
Merged

Fixes #3028

merged 11 commits into from
Feb 19, 2025

Conversation

ouziel-slama
Copy link
Contributor

@ouziel-slama ouziel-slama commented Feb 18, 2025

  • Accept --catch-up flag before the command
  • Make RSFecther less verbose
  • Add locust runner to test local node
  • Refactor shutdown
    • KISS: we don't try to close all connections anymore, sqlite3 is designed for that. This ensures that all processes are
      properly stopped and that the API port is released.
    • Using a CounterparyServer thread, which is started with start() and stopped with stop().
    • Add an integration test for shutdown

  • Double-check the spelling and grammar of all strings, code comments, etc.
  • Double-check that all code is deterministic that needs to be
  • Add tests to cover any new or revised logic
  • Ensure that the test suite passes
  • Update the project release notes
  • Update the project documentation, as appropriate, with a corresponding Pull Request in the Documentation repository

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 45.90164% with 66 lines in your changes missing coverage. Please review.

Project coverage is 77.61%. Comparing base (19559b5) to head (722bbb6).
Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
...unterparty-core/counterpartycore/lib/cli/server.py 51.08% 45 Missing ⚠️
...erparty-core/counterpartycore/lib/parser/follow.py 0.00% 13 Missing ⚠️
...erparty-core/counterpartycore/lib/api/apiserver.py 42.85% 4 Missing ⚠️
...arty-core/counterpartycore/lib/backend/bitcoind.py 33.33% 2 Missing ⚠️
...erparty-core/counterpartycore/lib/parser/blocks.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3028      +/-   ##
===========================================
- Coverage    80.65%   77.61%   -3.05%     
===========================================
  Files           99       99              
  Lines        13375    13390      +15     
===========================================
- Hits         10788    10393     -395     
- Misses        2587     2997     +410     

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

wsgi_server = wsgi.WSGIApplication(app, args=args)
except OSError as e:
logger.error(f"Error starting WSGI Server: {e}")
exit(1)

Check warning

Code scanning / pylint

Consider using 'sys.exit' instead. Warning

Consider using 'sys.exit' instead.
if not k.startswith("__") and not k.startswith("DEFAULT_")
}
logger.debug(f"Config: {custom_config}")
class CounterpartyServer(threading.Thread):

Check warning

Code scanning / pylint

Too many instance attributes (12/7). Warning

Too many instance attributes (12/7).
self.log_stream = log_stream

# Log all config parameters, sorted by key
# Filter out default values #TODO: these should be set in a different way

Check warning

Code scanning / pylint

Filter out default values #TODO: these should be set in a different way. Warning

Filter out default values #TODO: these should be set in a different way.
server.join(1)
except KeyboardInterrupt:
logger.warning("Keyboard interrupt received. Shutting down...")
except Exception as e:

Check warning

Code scanning / pylint

Catching too general exception Exception. Warning

Catching too general exception Exception.
@@ -11,6 +11,7 @@
from urllib.parse import quote_plus as urlencode

import appdirs
import apsw

Check warning

Code scanning / pylint

Unable to import 'apsw'. Warning

Unable to import 'apsw'.
try:
check.asset_conservation(self.db, self.stop_event)
except exceptions.SanityError as e:
logger.error("Asset conservation check failed: %s" % e)

Check warning

Code scanning / pylint

Use lazy % or .format() formatting in logging functions. Warning

Use lazy % or .format() formatting in logging functions.
try:
check.asset_conservation(self.db, self.stop_event)
except exceptions.SanityError as e:
logger.error("Asset conservation check failed: %s" % e)

Check warning

Code scanning / pylint

Formatting a regular string which could be an f-string. Warning

Formatting a regular string which could be an f-string.
@@ -255,7 +257,7 @@
self.check_software_version_if_needed()
late_since = None

while True:
while True and not self.stop_event.is_set():

Check warning

Code scanning / pylint

Boolean condition "True and not self.stop_event.is_set()" may be simplified to "not self.stop_event.is_set()". Warning

Boolean condition "True and not self.stop_event.is_set()" may be simplified to "not self.stop_event.is_set()".
Base automatically changed from batch to develop February 19, 2025 15:02
@ouziel-slama ouziel-slama merged commit 2176230 into develop Feb 19, 2025
31 of 33 checks passed
@ouziel-slama ouziel-slama deleted the fixes branch February 19, 2025 19:59
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.

3 participants