Coder Social home page Coder Social logo

Comments (11)

skybber avatar skybber commented on May 24, 2024

Did you really updated DB when the clients were running ? If so, then it is not suprising that the client crashed. You should always stop the parser before you update the DB .

from udger-java.

kutchar avatar kutchar commented on May 24, 2024

@skybber What is the correct procedure to update the DB when using the inMemoryEnabled=true?
A bit context, I have a cron that updates the DB nightly and I have a long running Java process that loads the DB into memory and processes the requests. We would like to reload the DB when the DB file is updated without restarting the Java process.

from udger-java.

gierlachg avatar gierlachg commented on May 24, 2024

We have similar use case - reloading DB without process restart.
I believe it might be related to UdgerParser static members...

private static WordDetector clientWordDetector;
private static WordDetector deviceWordDetector;
private static WordDetector osWordDetector;

private static List<IdRegString> clientRegstringList;
private static List<IdRegString> osRegstringList;
private static List<IdRegString> deviceRegstringList;

Is there any specific reason for them to be static? Using parser from multiple threads is not safe anyway as far as I know.

from udger-java.

skybber avatar skybber commented on May 24, 2024

The original idea was to keep expensive precalculated data in static cache, but it seems that most frequent use case is not to create Parsers frequently. I have to check how is it with memory consumption. Anyway the thread safety is ridden by mysql driver, which is not thread safe.

from udger-java.

gierlachg avatar gierlachg commented on May 24, 2024

Have you managed to verify memory consumption? Is it feasible to get rid of statics and make Udger reloadable?

from udger-java.

skybber avatar skybber commented on May 24, 2024

Parser stores precalculated data in statics. We can store them in a some non-static context, but then we have to change the parser API. For now, I've added static reset method to nullify them, but we have to extend the API by the context in the future. Would be the reset method enough for you?

from udger-java.

gierlachg avatar gierlachg commented on May 24, 2024

I don't think 'reset' would be appropriate for us.
Right now we have a pool of parsers, accessed from many threads (however one at a time).
We would like to be able to create new instance of parser (with latest data) while old one could still be theoretically in use (ongoing requests etc.).

from udger-java.

skybber avatar skybber commented on May 24, 2024

Are you using same file dbFileName for old/new DB ?

from udger-java.

gierlachg avatar gierlachg commented on May 24, 2024

I'm not sure I understand what you mean.
While creating UdgerParser we pass dbFileName, yes. For different versions it is a different file though.

from udger-java.

skybber avatar skybber commented on May 24, 2024

Runtime DB change support just added in v1.1.0.

from udger-java.

gierlachg avatar gierlachg commented on May 24, 2024

Awesome. Thanks!

from udger-java.

Related Issues (13)

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.