-
Notifications
You must be signed in to change notification settings - Fork 44
[WIP] feat: separate performance collection and distribution #802
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
base: csm-next
Are you sure you want to change the base?
Conversation
…collector # Conflicts: # poetry.lock # pyproject.toml # src/main.py # src/modules/csm/csm.py # src/web3py/types.py # tests/fork/conftest.py
| try: | ||
| return func(*args, **kwargs) | ||
| except ValueError as exc: | ||
| return jsonify({"error": str(exc)}), 400 |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
| except ValueError as exc: | ||
| return jsonify({"error": str(exc)}), 400 | ||
| except Exception as exc: # pylint: disable=broad-exception-caught | ||
| return jsonify({"error": repr(exc), "trace": traceback.format_exc()}), 500 |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
| if ver != cls.VERSION: | ||
| raise ValueError(f"Unsupported epoch blob version: {ver}") |
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.
Manual intervention is required then?
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.
It should prevent reading outdated blobs from Performance Collector that we aren't able to decode due to different version of encoding algo
| self._conn = sqlite3.connect( | ||
| self._path, check_same_thread=False, timeout=variables.PERFORMANCE_COLLECTOR_DB_CONNECTION_TIMEOUT | ||
| ) |
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.
What if we have an optional _conn field that is opened via a separate method such as connect and reused in theconnection context manager? The context manager checks whether a connection has been established and uses it, or opens a new one otherwise. Thus, clients that prefer to keep the connection open can use the connect method and close it eventually, while other clients can use the connection context manager. I would also consider using the latter only. I think it is cheap to open a connection, do whatever is needed and close it afterwards.
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.
To ensure thread safety I would also add an assert that we in the preferred mode of operation, see threadsafety.
Description
Separate Performance Collection module for CSMv3 and CMv2 Oracle daemons
Related Issue/Task
How Has This Been Tested?
Describe how you tested the changes:
pytest)Checklist
CSM_STATE_VERSIONis bumped (if the new version affects data in the cache)