Giter VIP home page Giter VIP logo

Comments (24)

Vaelatern avatar Vaelatern commented on September 28, 2024

Further edits: I was on 0.4.1, using the file backend, and have no fewer than 4 separate file-backed duratoms in the same app. My users are now on 0.5.1 while I figure out this migration.

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Hi there,

This shouldn't happen! Can you confirm which version you're seeing this under, and perhaps provide some example code? Thanks in advance...

Kind regards

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

The duratom that lost state was configured
:local-file :file-path "./..." :init ....

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Oh wow! We literally pressed comment at the same time!!!

Ok, so there was a time when util/pr-str-fully wasn't fully printing, but it should definitely do now...Are you seeing the same data-loss with 0.5.1?

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

I'm going to find out. Would that function have truncated the print or not printed all values in the atom?

from duratom.

jimpil avatar jimpil commented on September 28, 2024

It would have truncated, due to *print-length* and *print-level*. See here:

(defn pr-str-fully

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

Ok, this was not the corruption I was seeing. I saw user data seemingly never written to disk, for a restart to then change their passwords back to one from their past.

from duratom.

jimpil avatar jimpil commented on September 28, 2024

I don't fully follow...are you saying that duratom can't write to a file at all, beyond a particular size?

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

I'm saying that given my large state, yes, Duratom seemed to stop writing to the file.

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Are you by any chance using a custom :rw map?

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

I am not

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Ok, this is bizarre - 620kb is by no means a large file... I'll try to reproduce later tonight when I come back from work. In the meantime, would it be easy for you to try your use-case against a different storage-backend (e.g. postgres)? That will provide a good indication about where the problem lies (i.e. the duratom object itself VS the backend object).

Many thanks in advance...

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Something else that could be happening is swallowed exceptions on the agent's dispatch thread (for async commits). There was no way to specify an :error-handler on 0.4.1, but there is on 0.5.1, and I would advise you to use it for (at least) logging the errors, and potentially re-commiting (second arg on the error-handler).

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

I don't seem to be able to set :error-handler without setting a custom reader or writer.

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

I'll be working on this in many hours, thank you for your help.

from duratom.

jimpil avatar jimpil commented on September 28, 2024
(assoc default-file-rw 
  :error-handler 
  (fn ([agent exception] ...) ;; typical agent errror-handler
      ([agent exception recommit!] ...))) ;; persistence error-handler

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024
Caused by: java.lang.NullPointerException
        at duratom.backends.FileBackend.snapshot(backends.clj:68)
        ... 110 more

Now duratom can't start, same as before

from duratom.

harold avatar harold commented on September 28, 2024

I appreciate both your efforts here, and look forward to discovering the root cause of this. We have gigabytes of duratoms and have never encountered what you're hitting here.

Good luck, and keep it up until you find it.

Thanks!

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Some more stack-traces would be helpful...I will try this in a few hours anyway.

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

That's the only stack trace I have, and it's of not having a successful :rw map

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

Ok, now able to log my attempts. Will see what happens!

from duratom.

jimpil avatar jimpil commented on September 28, 2024

Any news on this? I wasn't able to reproduce any data loss using a 12MB file...

from duratom.

Vaelatern avatar Vaelatern commented on September 28, 2024

Hanging out waiting for it to fail, it hasn't yet. I don't know when it happens, but I have logging set up to catch exceptions. And I'm glad I'm on the latest version now.

from duratom.

jimpil avatar jimpil commented on September 28, 2024

I think we've established that persisting values greater than 620kb (or a lot larger for that matter) does work as expected. Can I close this? If you happen to find some further problem, it will most likely be unrelated to this, so it will warrant its own ticket.

from duratom.

Related Issues (16)

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.