Giter Site home page Giter Site logo

cuckoo's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar mtchavez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cuckoo's Issues

Race Condition When Writing Filter to Disk

I have something similar to this:

package main

import (
  "github.com/mtchavez/cuckoo"
  "sync"
)

type struct Persister {
  filter cuckoo.Filter
  fileName string
  lock sync.Mutex
}

func (p *Persister) Save() {
  p.lock.Lock()
  defer p.lock.Unlock()

  p.filter.Save(p.fileName)
}

I have multiple goroutines attempting to call Persister.Save() after modifications to ensure that changes get persisted.

Since when Filter.Save() returns, there seems to be no guarantee that the data is written to disk, it appears that these goroutines truncate file writes for each other and everything descends into madness with the size of my Filter growing in memory within the program, but flapping in terms of disk file size: I see sizes of 29, 2MiB, 4MiB, and other values between, as these writes appear to be overlapping each other.

I'm not sure what the solution would be at the API level, but providing some way to guarantee consistency would be really helpful. For now, I have refactored my code to offset writes by consistent time periods using time.Ticker.

Dependabot cannot be upgraded to GitHub-native version due to unsupported `dep` package manager

Dependabot Preview will be shut down on August 3rd, 2021.

It appears that this repository has configured updates for dep.

The GitHub-native version of Dependabot does not support dep, which was deprecated as of 2020.
Guidance from the dep maintainers is to upgrade to go mod, which Dependabot supports.

In order to keep getting updates for your Go dependencies, you'll need to migrate to go mod and add a Dependabot configuration for it to this repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.