marius311 / Memoization.jl

Easily and efficiently memoize any function, closure, or callable object in Julia.
MIT License
99 stars 2 forks source link

World-Age issues with --compiled-modules=no #11

Closed manuelbb-upb closed 3 years ago

manuelbb-upb commented 3 years ago

Within a project I tried to use Memoization.jl because it is supposed to be usable with ThreadSafeDicts. I noticed that my tests were failing due to world age problems with

using ThreadSafeDicts
using Memoization

With using ThreadSafeDicts, Memoization, only the nightly build of Julia succeeded, but 1.5 failed nonetheless. The specific error was

Got exception outside of a @test
  MethodError: no method matching ThreadSafeDicts.ThreadSafeDict()
  The applicable method may be too new: running in world age 27819, while current world is 27902.

I decided to forgo ThreadSafeDicts for the moment, which seemed to help at first. But when running the tests with precompilation disabled, i.e., --compiled-modules=no, I got

MethodError: no method matching _get!(::Type{IdDict}, ::IdDict{Any, Any}, ::Tuple{DataType, UnionAll})
The applicable method may be too new: running in world age 46020, while current world is 49606.

The problems seem related somehow.

For now, I have switched back to Memoize.jl. It does not throw the above errors and seems to also work with ThreadSafeDicts.

marius311 commented 3 years ago

Thanks for the report, I can reproduce and have a fix, will try to get it pushed up today.

marius311 commented 3 years ago

Fixed on v0.1.6 which is now tagged and ready to go. Let me know if you run into anything else.