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

NXDRIVE-2523: Prevent crashes because of too many opened file descrip… #2497

Merged
merged 3 commits into from Feb 23, 2021

Conversation

BoboTiG
Copy link
Contributor

@BoboTiG BoboTiG commented Feb 23, 2021

…tors

The issue was not visible quickly but when Drive was running a long time with a lot of synchronization actions. Each thread was opening a connection to the SQLite database file, but it was never released.

@nuxeojenkins
Copy link
Contributor

View issue in JIRA: NXDRIVE-2523: Prevent crashes because of too many opened file descriptors

Mickaël Schoentgen added 3 commits February 23, 2021 15:31
…tors

The issue was not visible quickly but when Drive was running a long
time with a lot of synchronization actions. Each thread was opening
a connection to the SQLite database file, but it was never released.
@BoboTiG BoboTiG force-pushed the wip-NXDRIVE-2523-crash-2nd-try branch from 34403c8 to 2fb2483 Compare February 23, 2021 14:32
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 23, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.23%.

Quality metrics Before After Change
Complexity 1.21 ⭐ 1.17 ⭐ -0.04 👍
Method Length 49.93 ⭐ 49.31 ⭐ -0.62 👍
Working memory 7.57 🙂 7.41 🙂 -0.16 👍
Quality 78.00% 78.23% 0.23% 👍
Other metrics Before After Change
Lines 1025 1010 -15
Changed files Quality Before Quality After Quality Change
nxdrive/engine/dao/sqlite.py 80.15% ⭐ 80.75% ⭐ 0.60% 👍
tests/unit/test_engine_dao.py 75.96% ⭐ 75.96% ⭐ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
nxdrive/engine/dao/sqlite.py EngineDAO.get_dt_uploads_raw 3 ⭐ 74 🙂 26 ⛔ 55.00% 🙂 Extract out complex expressions
nxdrive/engine/dao/sqlite.py EngineDAO.get_completed_sessions_raw 0 ⭐ 68 🙂 31 ⛔ 58.01% 🙂 Extract out complex expressions
tests/unit/test_engine_dao.py test_configuration_get_bool 0 ⭐ 283 ⛔ 8 🙂 58.08% 🙂 Try splitting into smaller methods
nxdrive/engine/dao/sqlite.py EngineDAO.get_active_sessions_raw 0 ⭐ 65 🙂 30 ⛔ 58.60% 🙂 Extract out complex expressions
nxdrive/engine/dao/sqlite.py EngineDAO.get_dt_uploads 2 ⭐ 64 🙂 19 ⛔ 60.67% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@BoboTiG BoboTiG merged commit c6157f1 into master Feb 23, 2021
@BoboTiG BoboTiG deleted the wip-NXDRIVE-2523-crash-2nd-try branch February 23, 2021 14:40
@BoboTiG BoboTiG added this to the 5.1.0 milestone Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants