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

Logic around sensor _on_stream_event_in differs between cython and python implementations #607

Closed
2 tasks done
Tim-Thomas opened this issue Feb 15, 2024 · 0 comments · Fixed by #608
Closed
2 tasks done

Comments

@Tim-Thomas
Copy link
Contributor

Checklist

  • I have included information about relevant versions
  • I have verified that the issue persists when using the master branch of Faust.

I recently added prometheus metrics instrumentation to one of my teams projects that's using faust-streaming. However, many of the per-agent metrics I was expecting to appear did not appear. After extensive debugging, I realized that this is due to agents using yield and sink were not correctly invoking _on_stream_event_in per event.

I dug through the cython and python implementations of the stream handling and discovered that in cython, _on_stream_event_in is being invoked conditionally alongside _on_message_in:
https://github.com/faust-streaming/faust/blob/master/faust/_cython/streams.pyx#L177-L183
but in the python implementation, the _on_stream_event_in is being invoked all the time in this code path:
https://github.com/faust-streaming/faust/blob/master/faust/streams.py#L1182-L1190

These cannot both be correct. I believe the correct behavior is the python one.

Expected behavior

I expect that _on_stream_event_in should be called per stream event in both the cython and python impls.

Actual behavior

_on_stream_event_in is not invoked per stream event when using the cython implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant