Comments (11)
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.
@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.
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.
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.
Have you managed to verify memory consumption? Is it feasible to get rid of statics and make Udger reloadable?
from udger-java.
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.
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.
Are you using same file dbFileName for old/new DB ?
from udger-java.
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.
Runtime DB change support just added in v1.1.0.
from udger-java.
Awesome. Thanks!
from udger-java.
Related Issues (13)
- NPE at org.udger.parser.UdgerParser.patchVersions(UdgerParser.java:667) HOT 2
- Parsing differenct to udger-python leading to missmatched HOT 1
- Ctor overloading - ignoring inMemoryEnabled arguemnt HOT 1
- Parsing fails with ArrayIndexOutOfBoundsException on slightly malformed UA HOT 1
- Remove System.out.println(). HOT 1
- Publish to Maven Central HOT 3
- WordDetector cannot handle words starting with 2 underscores
- Udger throwing exception HOT 1
- Use Logger instead of System.out.println HOT 6
- Implement toString() method for UdgerUaResult HOT 1
- NPE at org.udger.parser.LRUCache$Node.access$202(LRUCache.java:14) HOT 1
- Provide the 'isValid' functionality from the Connection in the UdgerParser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from udger-java.