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

Locking for shares part 1 #11 #74

Merged
merged 25 commits into from
Feb 2, 2022
Merged

Locking for shares part 1 #11 #74

merged 25 commits into from
Feb 2, 2022

Conversation

dagl
Copy link
Contributor

@dagl dagl commented Sep 16, 2021

Locking for concurrently edited shared files. There was a need for a large refactoring because of duplicate code and not working tests.

Copy link
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

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

I believe I see many changes not necessarily related to this PR (like cleanups, fixes here and there, comments). It's better to separate things into smaller and thematic PRs, which makes it easier to review and results in a cleaner history.

But, either way, I've done some request and questions. I think the biggest change is that we should make the locking transparent and integrate it inside the save/read API. Ah, and just lock all the time, not only on shared files. Also, let's try to optimize this and cache things + reduce the amount of calls we do to reva for any single/simple operation.

Thanks!

jupyter-config/jupyter_cs3_config.json Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
cs3api4lab/api/cs3_file_api.py Outdated Show resolved Hide resolved
cs3api4lab/api/cs3_file_api.py Outdated Show resolved Hide resolved
cs3api4lab/utils/file_utils.py Outdated Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/api/share_api_facade.py Outdated Show resolved Hide resolved
cs3api4lab/logic/storage_logic.py Show resolved Hide resolved
Copy link
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

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

Sorry, it passed so much time since the initial review that I hope I didn't repeat myself. :)
Just some comments. Please rebase as well, as there are conflicts and we cannot merge.
Ans please resolve what is still open.
Thanks

cs3api4lab/api/cs3_file_api.py Outdated Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/logic/storage_logic.py Show resolved Hide resolved
@dagl
Copy link
Contributor Author

dagl commented Jan 9, 2022

I'm sorry for the last time, I pushed incomplete commit. This time everything should be fine.

@diocas
Copy link
Contributor

diocas commented Jan 11, 2022

Can you please rebase? I'm seeing tons of commits that should not be here.

@dagl
Copy link
Contributor Author

dagl commented Jan 13, 2022

Can you please rebase? I'm seeing tons of commits that should not be here.

done

@dagl
Copy link
Contributor Author

dagl commented Jan 19, 2022

Can you please rebase? I'm seeing tons of commits that should not be here.

Actually wait, I didn't do the rebase correctly

@lgtm-com
Copy link

lgtm-com bot commented Jan 20, 2022

This pull request introduces 8 alerts when merging d6f4a1a into a8b828c - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Jan 20, 2022

This pull request introduces 8 alerts when merging 55eda18 into a8b828c - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Jan 20, 2022

This pull request introduces 8 alerts when merging e1276b2 into a8b828c - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Jan 21, 2022

This pull request introduces 8 alerts when merging 41616c5 into 6a188ba - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@diocas
Copy link
Contributor

diocas commented Jan 24, 2022

@dagl the pipeline doesn't work because the extension is not ok. You have 2 folders (logic and utils) that are not treated as modules because they don't have the __init__.py file inside.
If you pip install the extension and do the command that fails in the pipeline, you see that it fails while trying to import.

@dagl
Copy link
Contributor Author

dagl commented Jan 24, 2022

@dagl the pipeline doesn't work because the extension is not ok. You have 2 folders (logic and utils) that are not treated as modules because they don't have the __init__.py file inside. If you pip install the extension and do the command that fails in the pipeline, you see that it fails while trying to import.

Ok thanks, it worked.

@dagl dagl closed this Jan 24, 2022
@dagl dagl reopened this Jan 24, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jan 24, 2022

This pull request introduces 8 alerts when merging 4f89f46 into 6ae505b - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

Copy link
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

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

One extra round. Also check the lgtm review (i.e change the except: for except Exception:)

.gitignore Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
cs3api4lab/api/cs3_file_api.py Outdated Show resolved Hide resolved
cs3api4lab/api/cs3_file_api.py Show resolved Hide resolved
cs3api4lab/api/cs3_file_api.py Show resolved Hide resolved
cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
cs3api4lab/api/share_api_facade.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
cs3api4lab/api/share_api_facade_ocmless.py Outdated Show resolved Hide resolved
else:
content_len = len(content.decode('utf-8'))
# providing '0' as size leads to unexpected additional file creation
Copy link
Contributor

Choose a reason for hiding this comment

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

I pinged you in some PR because this was already fixed in REVA.

@lgtm-com
Copy link

lgtm-com bot commented Jan 25, 2022

This pull request introduces 8 alerts when merging 1893293 into 0a09092 - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Jan 25, 2022

This pull request introduces 8 alerts when merging 6883807 into 0a09092 - view on LGTM.com

new alerts:

  • 3 for Except block handles 'BaseException'
  • 3 for Unused import
  • 1 for Testing equality to None
  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2022

This pull request introduces 1 alert and fixes 2 when merging d221696 into 258da93 - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'

fixed alerts:

  • 2 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jan 31, 2022

This pull request fixes 2 alerts when merging eee2de4 into 258da93 - view on LGTM.com

fixed alerts:

  • 2 for Unused import

Copy link
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

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

Let's merge this after the questions I've asked (even the ones in previous reviews) are resolved.

else:
content_len = len(content.decode('utf-8'))
# providing '0' as size leads to unexpected additional file creation
Copy link
Contributor

Choose a reason for hiding this comment

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

You removed the code, right? (At least I'm not seeing it) So please remove the comment above as well.

cs3api4lab/api/lock_manager.py Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2022

This pull request fixes 2 alerts when merging bb6cfed into 258da93 - view on LGTM.com

fixed alerts:

  • 2 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Feb 1, 2022

This pull request fixes 2 alerts when merging 058ad2d into 258da93 - view on LGTM.com

fixed alerts:

  • 2 for Unused import

@diocas diocas merged commit deb18bc into sciencemesh:master Feb 2, 2022
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