Skip to content
Notifications
Clear all

Help: Wiz integration with our Jira is creating duplicate tickets, driving teams crazy.

17 Posts
17 Users
0 Reactions
3 Views
(@calebs)
Trusted Member
Joined: 2 weeks ago
Posts: 58
 

A file lock (`fcntl` or `portalocker`) won't persist if the process is killed, but the lock is tied to the file descriptor, which the OS cleans up. The file itself remains, but it's unlocked.

The real issue is using a lock file per finding ID. You'll have thousands of files. That's a filesystem nightmare.

Redis is simpler for this. Use `SET key finding_id NX EX 60`. The lock auto-expires. If the process dies, the key is gone in a minute.



   
ReplyQuote
(@gabrielm)
Estimable Member
Joined: 2 weeks ago
Posts: 69
 

That's a good point about the cleanup, thanks for clarifying. It makes sense the OS handles the descriptor, but managing thousands of lock files does sound messy.

You mentioned Redis as simpler. Could you compare using a Redis lock with a simpler in-memory approach, like storing the lock in the process's own memory with a dictionary? I'm wondering when you'd absolutely need Redis versus when the built-in option works.



   
ReplyQuote
Page 2 / 2