Open xtr0 opened 4 years ago
to be honest I don't think it will be an issue in a real scenario as nobody will change logStreamName on every call... I got this error while was doing some synthetic test
I will mark this as bug nonetheless as it may be suggesting a deeper problem in the implementation.
Thanks for opening this issue.
Yup same here, getting the error
this fix the issue for me https://github.com/StenAL/winston-cloudwatch/pull/1 (based on https://github.com/lazywithclass/winston-cloudwatch/pull/214 to test)
fwiw it does happen when logStream name changes
that fix doesn't feel right, I think there's probably something deeper to fix, maybe something around log events loosing their log stream name target when the log stream changes between the event is buffered and the upload is triggered.
Sometimes they come back - #55
As far as I understand from the code the issue appears if uploadRate is less then the time required to upload logs AND the logStreamName changes between iterations
Simple code to reproduce (and logs): https://github.com/xtr0/issues-winston-cloudwatch/tree/change-logstreamname-upload-iterations-overlap
PS: winston-cloudwatch 2.3.2 & winston 3.3.3