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

Migrate to qtrio #1771

Merged
merged 35 commits into from
Aug 2, 2021
Merged

Migrate to qtrio #1771

merged 35 commits into from
Aug 2, 2021

Conversation

vxgmichel
Copy link
Contributor

A draft for a potential qtrio migration.

This means we don't have to deal with separate qt/trio threads and that we can perform qt calls withing trio coroutines.

@vxgmichel vxgmichel force-pushed the qtrio-migration branch 2 times, most recently from 5d2746e to a997080 Compare June 23, 2021 16:15
@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #1771 (c3302fc) into master (54133d2) will increase coverage by 0.00%.
The diff coverage is 83.90%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #1771    +/-   ##
========================================
  Coverage   87.70%   87.70%            
========================================
  Files         245      245            
  Lines       23895    23795   -100     
========================================
- Hits        20957    20870    -87     
+ Misses       2938     2925    -13     
Impacted Files Coverage Δ
parsec/core/gui/custom_dialogs.py 69.54% <0.00%> (-0.29%) ⬇️
parsec/core/gui/claim_device_widget.py 88.15% <33.33%> (-0.19%) ⬇️
parsec/core/gui/claim_user_widget.py 87.62% <45.45%> (-0.18%) ⬇️
parsec/core/gui/timestamped_workspace_widget.py 28.23% <50.00%> (-0.69%) ⬇️
parsec/core/gui/app.py 74.16% <59.37%> (-0.84%) ⬇️
parsec/core/gui/new_version.py 51.76% <62.50%> (-0.62%) ⬇️
parsec/core/gui/file_history_widget.py 79.59% <83.33%> (ø)
parsec/core/gui/files_widget.py 78.70% <87.93%> (+0.24%) ⬆️
parsec/core/gui/create_org_widget.py 87.39% <88.88%> (+0.05%) ⬆️
parsec/core/gui/trio_jobs.py 89.39% <89.39%> (ø)
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54133d2...c3302fc. Read the comment docs.

@vxgmichel vxgmichel force-pushed the qtrio-migration branch 3 times, most recently from 250184e to 3fcfe68 Compare July 20, 2021 09:28
@vxgmichel vxgmichel marked this pull request as ready for review July 21, 2021 10:16
@vxgmichel
Copy link
Contributor Author

A bit of cleanup is still needed, in particular:

  • removing aqtbot.run
  • removing job.cancel_and_join

@vxgmichel
Copy link
Contributor Author

@touilleMan @Max-7 The PR is now ready to be reviewed :)

newsfragments/1711.misc.rst Outdated Show resolved Hide resolved
tests/core/gui/users_widget/test_claim.py Show resolved Hide resolved
tests/core/gui/conftest.py Outdated Show resolved Hide resolved
tests/core/gui/conftest.py Show resolved Hide resolved
tests/core/gui/conftest.py Outdated Show resolved Hide resolved
tests/core/gui/conftest.py Show resolved Hide resolved
parsec/core/gui/trio_thread.py Outdated Show resolved Hide resolved
pass
self._done.wait()
def cancel(self):
self.cancel_scope.cancel()


class QtToTrioJobScheduler:
Copy link
Member

Choose a reason for hiding this comment

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

In theory this whole job system is no longer needed right ? (it is just kept to avoid a huge refactoring of the codebase)

Copy link
Contributor Author

@vxgmichel vxgmichel Jul 29, 2021

Choose a reason for hiding this comment

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

We still need a nursery with some throttle logic (submit_throttled_job), so it's still useful. Wrapping trio tasks as jobs that we can retrieve or cancel also makes sense. The major cleanup would be getting rid of the qt_on_success and qt_on_error signals.

parsec/core/gui/trio_thread.py Outdated Show resolved Hide resolved
parsec/core/gui/app.py Outdated Show resolved Hide resolved
@vxgmichel
Copy link
Contributor Author

More clean up can still be done:

  • Get rid of the _trio callback to _qt callback logic
  • Get rid of the _success and _error signals

@vxgmichel
Copy link
Contributor Author

122 signals and corresponding callbacks to migrate..

± git grep "pyqtSignal(QtToTrioJob)" | wc -l
122

@vxgmichel vxgmichel requested a review from touilleMan July 29, 2021 17:42
Copy link
Member

@touilleMan touilleMan left a comment

Choose a reason for hiding this comment

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

lgtm
image

parsec/core/gui/files_widget.py Show resolved Hide resolved
parsec/core/gui/timestamped_workspace_widget.py Outdated Show resolved Hide resolved
parsec/core/gui/trio_thread.py Outdated Show resolved Hide resolved
parsec/core/mountpoint/manager.py Show resolved Hide resolved
tests/core/gui/conftest.py Outdated Show resolved Hide resolved
tests/core/gui/test_workspaces.py Show resolved Hide resolved
@vxgmichel vxgmichel merged commit 78aa989 into master Aug 2, 2021
@vxgmichel vxgmichel deleted the qtrio-migration branch August 2, 2021 15:15
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