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

set TaskOnKart.raise_task_lock_exception_on_collision as false #342

Conversation

mski-iksm
Copy link
Contributor

RedisParams.raise_task_lock_exception_on_collision is a option whether to fail when TaskLockException is raised (when True), or just wait until the lock is released (when False).

Originally, this setting was passed from TaskOnKart.raise_task_lock_exception_on_collision.
However, this option is not needed since task collision lock of TaskOnKart.dump() don't want to fail even when TaskLockException is raised.
Rather, we want to wait until the lock is released.

In this PR, I've changed the raise_task_lock_exception_on_collision as False for task collision lock of TaskOnKart.dump().

@mski-iksm mski-iksm marked this pull request as draft January 10, 2024 06:23
@mski-iksm mski-iksm marked this pull request as ready for review January 10, 2024 06:40
@@ -176,7 +173,8 @@ def make_target(self, relative_file_path: Optional[str] = None, use_unique_id: b
redis_host=self.redis_host,
redis_port=self.redis_port,
redis_timeout=self.redis_timeout,
raise_task_lock_exception_on_collision=self.raise_task_lock_exception_on_collision)
raise_task_lock_exception_on_collision=False)
Copy link
Member

Choose a reason for hiding this comment

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

@mski-iksm Plz describe why we need to keep raise_task_lock_exception_on_collision for make_redis_params while this is always set to be False

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hi-king
In the coming feature, TaskOnKart.run() will be wrapped with task collision lock to prevent running same task at the same time.
I want to keep RedisParams.raise_task_lock_exception_on_collision to be used in this new feature.

Copy link
Member

Choose a reason for hiding this comment

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

@mski-iksm Thx for clarifying :)

@Hi-king Hi-king merged commit cc1e849 into m3dev:master Jan 12, 2024
5 checks passed
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