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

[Core] Fix overriding of next resync status when cancelled due to scheduled resync #1035

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.10.12 (2024-09-19)

### Bug Fixes

- Fixed updating state of resync when the resync is being cancelled by a new resync event

## 0.10.11 (2024-09-17)

### Improvements
Expand Down
4 changes: 3 additions & 1 deletion port_ocean/core/integrations/mixins/sync_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ async def sync_raw_all(

creation_results.append(await task)
except asyncio.CancelledError as e:
logger.warning("Resync aborted successfully")
logger.warning("Resync aborted successfully, skipping delete phase. This leads to an incomplete state")
raise
else:
if not did_fetched_current_state:
logger.warning(
Expand Down Expand Up @@ -489,3 +490,4 @@ async def sync_raw_all(
{"before": entities_at_port, "after": flat_created_entities},
user_agent_type,
)
logger.info("Resync finished successfully")
4 changes: 4 additions & 0 deletions port_ocean/ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ async def execute_resync_all() -> None:
try:
await self.integration.sync_raw_all()
await self.resync_state_updater.update_after_resync()
except asyncio.CancelledError:
logger.warning(
"resync was cancelled by the scheduled resync, skipping state update"
)
except Exception as e:
await self.resync_state_updater.update_after_resync(
IntegrationStateStatus.Failed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.10.11"
version = "0.10.12"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand Down