Describe the bug
I am using the predict method of concurrent scenariosSolidified DecisionTree model。each in its own thread,I ocassionally get NPEs in Formula::x。I encountered a problem similar to #646
Expected behavior
The inference should run in parallel without any NPE, because inference should only require read access on the models internal variables.
Actual behavior
Stack trace:
java.lang.NullPointerException
at smile.data.formula.Formula$2.getDouble(Formula.java:358)
at smile.base.cart.OrdinalNode.predict(OrdinalNode.java:45)
at smile.base.cart.OrdinalNode.predict(OrdinalNode.java:45)
at smile.base.cart.OrdinalNode.predict(OrdinalNode.java:45)
at smile.classification.DecisionTree.predict(DecisionTree.java:348)
at smile.classification.DataFrameClassifier.predict(DataFrameClassifier.java:52)
Code snippet
Steps to reproduce:
1,Data conversion
2,Each runing makes predictions based on the transformed data
Describe the bug I am using the predict method of concurrent scenariosSolidified DecisionTree model。each in its own thread,I ocassionally get NPEs in Formula::x。I encountered a problem similar to #646 Expected behavior The inference should run in parallel without any NPE, because inference should only require read access on the models internal variables.
Actual behavior Stack trace:
Code snippet Steps to reproduce: 1,Data conversion 2,Each runing makes predictions based on the transformed data
Problem can be worked around by executing predict() in a synchronized method,but that is very undesirable as it creates a significant bottleneck.
Input data LearnModelData = (cookie=0, agent=0, referer=0, host=1, frequency=0, failSignNum=0, failPswNum=0, xss=0, webScan=0,result=1)
Additional context Oracle JDK 8 Smile 2.6 centos 7