hpi-epic/pricewars-consumer

Consumer stops buying

Opened this issue · 3 comments

Sometimes the consumer stops buying products.
I suspect that a specific buying behavior crashes if it is chosen. In that case, the consumer fails silently.
The consumer buys again, if it is stopped and started.
A temporary workaround is to only use buying behaviors that are known to work (cheapest, second cheapest).

I had the same problem when defining a new buying behavior without an implementation.
The consumer fails silently when trying to call the non-existing function.

I'm on the docker setup on Ubuntu.

For executing buying behaviors, Ruby's thread function is used for multithreading. If there is an exception in this thread, it would be raised. For debugging, you may comment that out in line 57 and see if an error is thrown.

Is that now fixed?

This is still an issue.

It's now possible to see a stack trace of the error when running the consumer in debug mode.
This will help finding the bug.