-
Notifications
You must be signed in to change notification settings - Fork 183
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
DatadogMonitor - IndexError: deque index out of range #113
Comments
…_out() can now be called with no state
…_out() can now be called with no state
class Stream(StreamT[T_co], Service):
....
async def _py_aiter(self) -> AsyncIterator[T_co]:
...
try:
while not self.should_stop:
event = None
do_ack = self.enable_acks # set to False to not ack event.
# wait for next message
value: Any = None
# we iterate until on_merge gives value.
while value is None and event is None:
...
if isinstance(channel_value, event_cls):
...
# call Sensors
sensor_state = on_stream_event_in(tp, offset, self, event)
...
...
if value is skipped_value:
continue
self.events_total += 1
try:
yield value
finally:
self.current_event = None
if do_ack and event is not None:
# This inlines self.ack
last_stream_to_ack = event.ack()
message = event.message
tp = event.message.tp
offset = event.message.offset
on_stream_event_out(tp, offset, self, event, sensor_state)
...
...
async def ack(self, event: EventT) -> bool:
...
# WARNING: This function is duplicated in __aiter__
last_stream_to_ack = event.ack()
message = event.message
tp = message.tp
offset = message.offset
self._on_stream_event_out(tp, offset, self, event)
... When calling |
#119 partial fix |
…_out() can now be called with no state
…be called with no state (#119) Co-authored-by: Vikram Patki <54442035+patkivikram@users.noreply.github.com>
I think that the issue in general still requires proper solution. #119 is a fix preventing exceptions but full solution is to write the code in a way that manually acknowledged events produce datadog/statsd/prometheus metrics correctly |
Steps to reproduce
process a stream with manual acknowledgement:
Expected behavior
stream to be processed without issues
Actual behavior
Agent crashes and restarts
Full traceback
Versions
The text was updated successfully, but these errors were encountered: