Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.

Conversation

@ubnt-michals
Copy link

@ubnt-michals ubnt-michals commented Aug 17, 2017

In case of network outage or DNS failure... with current setup logentries will try to reconnect indefinitely. In our case that's not a viable approach. We would like it to fail after a few attempts. I hope this PR correctly enables that functionality.

@ubnt-michals
Copy link
Author

Any chance to get this merged?

Copy link
Contributor

@stopal-r7 stopal-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few questions I have raised. I like the intention, we should definitely have this feature.

"babel": "6.5.2",
"babel-plugin-add-module-exports": "0.1.2",
"babel-plugin-syntax-decorators": "6.5.0",
"babel-plugin-transform-builtin-extend": "1.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change for along with the new entry on gobblefile.js?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is related to: src/error.js
here: ReconnectFailedError extends LogentriesError

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no better way doing this? without introducing a new dependency?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have babel-preset-es2015 which includes babel-plugin-transform-es2015-classes.

This last one supports partially and it recommends to use babel-plugin-transform-builtin-extend which also have limitations.

I am not sure.

this.drained = false;

if (this.reconnectFailed) {
this.ringBuffer.read();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are losing an event here, aren't we?

return this.records.shift();
}

empty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see the place we use this function.

_write(ch, enc, cb) {
this.drained = false;

if (this.reconnectFailed) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we trying to accomplish with this check?

this.emit(errorEvent, err);
this.debugLogger.log(`Error: ${err}`);
if (err instanceof ReconnectFailedError) {
this.ringBuffer.read(); // this connection failed, shift the buffer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are losing an event here. read() will return the ext event in the buffer by shifting it.

Copy link

@danilosterrapid7 danilosterrapid7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a loose method and some shifts in the buffer without a clear reason.

"babel": "6.5.2",
"babel-plugin-add-module-exports": "0.1.2",
"babel-plugin-syntax-decorators": "6.5.0",
"babel-plugin-transform-builtin-extend": "1.1.2",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is related to: src/error.js
here: ReconnectFailedError extends LogentriesError

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants