Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Resolve callback error and modified the entire retry logic #34
Conversation
| isValidToken = false; | ||
| return onError((new Error('Loggly Error (' + responseCode + '): ' + httpStatusCode.badToken.message))); | ||
| } | ||
| if (responseCode === httpStatusCode.success.code && bulk.attemptNumber >= eventRetried) { |
Shwetajain148
Jan 24, 2018
Author
@mchaudhary This condition checks if the event sent successfully after retrying "n" number of times with status code 200 then print a console message.
@mchaudhary This condition checks if the event sent successfully after retrying "n" number of times with status code 200 then print a console message.
| isBulk ? sendBulkLogs(mode) : sendInputLogs(mode); | ||
| }, sleepTimeMs); | ||
| } | ||
| if (mode.attemptNumber >= numberOfRetries) { |
Shwetajain148
Jan 24, 2018
Author
@mchaudhary This condition checks if the total number of retries has reached the maximum retrying limit then show the failed event message on console.
@mchaudhary This condition checks if the total number of retries has reached the maximum retrying limit then show the failed event message on console.
| isValidToken = false; | ||
| return onError((new Error('Loggly Error (' + responseCode + '): ' + httpStatusCode.badToken.message))); | ||
| } | ||
| if (responseCode === httpStatusCode.success.code && input.attemptNumber >= eventRetried) { |
Shwetajain148
Jan 24, 2018
Author
@mchaudhary This condition checks if the event sent successfully after retrying "n" number of times with status code 200 then print a console message.
@mchaudhary This condition checks if the event sent successfully after retrying "n" number of times with status code 200 then print a console message.
| sendInputLogs(input); | ||
| } | ||
| } | ||
| function createBulk(msgs) { |
Shwetajain148
Jan 24, 2018
Author
@mchaudhary In this function, I am attaching some fields with the event like attempt number, eventId and time to retry in so that later the library can identify which event was failed on which error and in what time this event needs to retry.
@mchaudhary In this function, I am attaching some fields with the event like attempt number, eventId and time to retry in so that later the library can identify which event was failed on which error and in what time this event needs to retry.
fbae04d
to
b92b702
|
Any ETA when this will be merged ? We have error |
|
Same here, we'd love to see this merged! |
|
Hey everyone, we apologize for the delay in processing this PR. I'm working right now on making sure it's brought to the right people's attention to be fixed ASAP. |
|
@mchaudhary Will there be a patch version bump to release this change? The current version 2.2.1 was updated 3 months ago. Thanks. |

@mchaudhary @mostlyjason In this PR, I have modified the entire error retry logic and have covered the below points:
Also, I took a reference of retry logic from here: https://github.com/logzio/logzio-nodejs/blob/master/lib/logzio-nodejs.js#L248-L258.
I checked the library behavior after these changes in a continue logging environment for about 8 hours and did not see any callback error. The issue is related to loggly/winston-loggly-bulk#13.
Update: I also tested the library code in both bulk & input mode for 15 days in a continue event logging environment. My node application did not break with any error.
Please review the changes.