Hi dev group,
I wanted to bring your attention to the issue that we have just
started seeing in Malawi - the stock-management service is
throwing StackOverflowError while processing StockEvent sent from
the requisition service on final approval, and therefore blocking
the ability to approve the requisition.
Apparently, this is not happening for all of the requisition
approvals and I'm not exactly clear on the frequency of this. So
far, I'm seeing this in two of our requisitions currently waiting
for approval. I've spent some time debugging this, but was not
able to find anything unusual about those two requisitions. I've
determined the line that throws the error though (it also wasn't
that obvious) and have put it in the ticket:
https://openlmis.atlassian.net/browse/OLMIS-3813
The StackOverflowError is coming from the circular references in
the toString() method, between StockEvent and StockEventLineItem
(as can be determined from the logs attached in the ticket). This
of course needs to be fixed, but I'm not sure this is a root cause
of the problem (otherwise, why isn't this a problem for all
approvals?)
Unfortunately, I'm not seeing any other workarounds than removing
all of the stock cards from the stock-management for the given
facility. Before taking this drastic step though, I wanted to see
if anyone else has got any ideas where the problem might be or
what better workaround exists.
Thanks,
Sebastian.
Sebastian
Brudziński
Software Developer / Team Leader
sbrud...@soldevelo.com
I agree with Josh.
Here are a few ideas for troubleshooting/reproducing (sounds like a tricky bug!):
That is just a few ideas. I hope some of this helps!
-Brandon
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
openlmis-dev...@googlegroups.com.
To post to this group, send email to
openlm...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/openlmis-dev/715b7f54-189b-4f7f-be4e-708c2655c735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello.
Thanks for your input, everyone.
I eventually found out that the problem was with duplicative
StockCards. The fix for duplicate Stock Cards being created was
apparently made in
https://openlmis.atlassian.net/browse/OLMIS-3533 but it didn't
make it into the 3.2.1 release.
Even though the root cause appears to have been fixed, we should
still resolve the issue with circular references in toString,
equals etc. - I've modifed the ticket I mentioned in the original
post to tackle this. Otherwise, we may end up with more difficult
to track issues, because of this. My best guess is that a
different error/exception/validation was originally triggered due
to that duplicative StockCard and an attempt to print the object
was actually failing and causing StackOverflow.
@Josh - As I've mentioned in the original post, I didn't believe the StackOverflow and this circular toString reference is a root cause of the problem. Lombok generates equals and toString methods using all fields by default though, and that's a problem, that I believe we should still fix. I agree that StockCards and StockCardLineItems have the same issue. The line I've marked actually lazily loads StockCard domain objects from the database, which has got references to StockCardLineItems and StockEvent. I've attached a screenshot from the debugger in the ticket.
Thanks again!
Sebastian.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/18BB2727-4CB4-4C72-B1A8-E67CEC324326%40villagereach.org.
For more options, visit https://groups.google.com/d/optout.
Sebastian
Brudziński
Software Developer / Team Leader
sbrud...@soldevelo.com
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.
To post to this group, send email to openlm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/715b7f54-189b-4f7f-be4e-708c2655c735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.
To post to this group, send email to openlm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/18BB2727-4CB4-4C72-B1A8-E67CEC324326%40villagereach.org.
For more options, visit https://groups.google.com/d/optout.
--
Sebastian Brudziński
Software Developer / Team Leader
sbrud...@soldevelo.com
SolDevelo Sp. z o.o. [LLC] / www.soldevelo.com
Al. Zwycięstwa 96/98, 81-451, Gdynia, Poland
Phone: +48 58 782 45 40 / Fax: +48 58 782 45 41
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/b460afde-0ca3-009c-7f8c-0b9f924901d1%40soldevelo.com.
Hi Łukasz,
it's not the bidirectional relation between StockEvent and
StockEventLineItem (and similarly between StockCard and
StockCardLineItems) itself that is the problem. I believe we can
still keep it. The problem is that the equals/toString/hashCode
methods of those classes use all the fields (meaning StockEvent
uses StockEvenLineItem and StockEventLineItem uses StockEvent.
Modifying those methods to only use relevant fields should be
sufficient (I believe Lombok allows to specify which fields should
be included in the generated methods). Anyways, I believe it's OK
to continue discussion about possible fixes/implementation in the
ticket linked in original post.
Best regards,
Sebastian.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/d7f291fe-2a9a-5dae-6fa2-32ff9e61adc5%40soldevelo.com.
Paweł Albecki
Software Developer
palb...@soldevelo.com
Thanks Pawel,
do you want to add that note to the ticket as well? I'm afraid it
will be lost here when the implementation kicks in.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/ae081ef1-a429-587f-3b15-cd6649687c52%40soldevelo.com.
Paweł Albecki
Software Developer
palb...@soldevelo.com