GithubHelp home page GithubHelp logo

theine-core's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on Tablesmith, a privacy-first, cross platform spreadsheet ETL app

theine-core's People

Contributors

yiling-j avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zhwei820

theine-core's Issues

Bug: panic `link id not match` with `tlfu` and `size=2`

I got the following error while writing unit-tests. Interestingly I got the error only with size=1 or size=2. So I hope it only impacts testing and not real life, but that's still unexpected.

from datetime import timedelta
from theine import Cache

def test(size):
    cache = Cache('tlfu', size)
   # set 1 and get it many times to make it the most frequently used
    cache.set(1, 1, timedelta(seconds=1000))
    for _ in range(10 * size):
        assert cache.get(1) == 1
    # fill the cache with keys that are never read again
    for i in range(10 * size):
        cache.set(i, i, timedelta(seconds=1000))      
    # get 1 again
    # note that I do not get the panic error if you remove the next line
    assert cache.get(1) == 1
    # try to write dummy keys again
    for i in range(10 * size):
        cache.set(i, i, timedelta(seconds=1000))

test(2)  # raises
test(3)  # ok

raises:

thread '<unnamed>' panicked at 'link id not match', src/metadata.rs:159:13
stack backtrace:
  [...]
  10:        0x1022dcd63 - core::panicking::panic_fmt::hc10ef4c7e7c3da2e
  11:        0x102290ac5 - theine_core::metadata::Link::remove_wheel::hac48c6eac45dc96a
  12:        0x10228dfbb - theine_core::core::TlfuCore::set::h794298ae1966b4d2
  13:        0x10228b809 - std::panicking::try::hec7d762371985e37
  [...]

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.