Skip to content

fix(sync): harden try_create duplicate recovery to Zabbix -32602 - #127

Closed
berlikm wants to merge 1 commit into
OpensourceICTSolutions:developmentfrom
berlikm:fix/sync-already-exists-race
Closed

berlikm wants to merge 1 commit into
OpensourceICTSolutions:developmentfrom
berlikm:fix/sync-already-exists-race

Conversation

@berlikm

@berlikm berlikm commented Jul 15, 2026 •

Copy link
Copy Markdown

Summary

Harden try_create duplicate recovery for Zabbix -32602.

Standalone vs development. Also included in #125 — merge separately or close after #125.

Recover from concurrent creates only when Zabbix reports Invalid params
(-32602) with an 'already exists' reason, and skip create when
get_create_params() is empty. Supersedes the looser substring match in #127.

Co-authored-by: berlikm <[email protected]>
@cursor
cursor Bot force-pushed the fix/sync-already-exists-race branch from 0d4cc5f to e72fa12 Compare July 30, 2026 23:18
@berlikm berlikm changed the title fix(sync): handle 'already exists' race condition in try_create fix(sync): harden try_create duplicate recovery to Zabbix -32602 Jul 30, 2026
@berlikm

berlikm commented Jul 31, 2026

Copy link
Copy Markdown
Author

Closing as superseded by #125.

Confirmed on fix/inherited-host-lifecycle tip (26f8786):

  • ZabbixSyncBase.try_create recovers only on Zabbix -32602 + already exists, with empty get_create_params() short-circuit
  • _is_duplicate_error is present and stricter than this PR: non-numeric code values are rejected via try/except instead of raising
  • Coverage lives in nbxsync/tests/utils/test_duplicate_recovery.py

This PR’s tip (e72fa12) is not an ancestor of #125, but its intent is already carried (and slightly hardened) there. Merging #127 on top would not add the fix and could only regress the non-int code guard.

Also: #129 has been rebased onto current #125 (bcd5d48); the previous hostsync.py conflict no longer applies when stacking 129 after 125.

@berlikm berlikm closed this Jul 31, 2026
@cursor
cursor Bot deleted the fix/sync-already-exists-race branch August 10, 2026 10:03
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.

1 participant