Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageObservedException appears while there aren't any duplicates #376

Open
marax27 opened this issue May 25, 2021 · 0 comments
Open

MessageObservedException appears while there aren't any duplicates #376

marax27 opened this issue May 25, 2021 · 0 comments

Comments

@marax27
Copy link

marax27 commented May 25, 2021

Hi. First of all: thanks for this library. I successfully implemented a couple small things. However, it seems that as the number of asserted facts increases, a MessageObservedException start showing up unexpectedly.

Minimal example:

from durable.lang import *

with ruleset('test'):
    @when_all(+m.integer)
    def handle_new_fact(c):
        pass

for n in range(100000):
    assert_fact('test', {'integer': n})

The error:

Traceback (most recent call last):
  File "run.py", line 12, in <module>
    assert_fact('test', f)
  File "C:\Users\kacper\.virtualenvs\fc-env-x_QF5ci4\lib\site-packages\durable\lang.py", line 676, in assert_fact       
    return get_host().assert_fact(ruleset_name, fact, complete)
  File "C:\Users\kacper\.virtualenvs\fc-env-x_QF5ci4\lib\site-packages\durable\engine.py", line 817, in assert_fact     
    return self._handle_function(rules, rules.assert_fact, fact, complete)
  File "C:\Users\kacper\.virtualenvs\fc-env-x_QF5ci4\lib\site-packages\durable\engine.py", line 790, in _handle_function
    rules.do_actions(func(args), callback)
  File "C:\Users\kacper\.virtualenvs\fc-env-x_QF5ci4\lib\site-packages\durable\engine.py", line 343, in assert_fact     
    return self._handle_result(durable_rules_engine.assert_fact(self._handle, json.dumps(fact, ensure_ascii=False)), fact)
  File "C:\Users\kacper\.virtualenvs\fc-env-x_QF5ci4\lib\site-packages\durable\engine.py", line 330, in _handle_result  
    raise MessageObservedException(message)
durable.engine.MessageObservedException: {'integer': 46010}

System information:

  • durable-rules 2.0.28
  • Python 3.8.5
  • Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant