Skip to content

fix reconnect issue for nodejs - #2407

Merged
Jens-G merged 4 commits into
apache:masterfrom
wujjpp:thrift-nodejs-reconnect-issue
Oct 25, 2022
Merged

Jens-G merged 4 commits into
apache:masterfrom
wujjpp:thrift-nodejs-reconnect-issue

Conversation

@wujjpp

@wujjpp wujjpp commented Jun 11, 2021

Copy link
Copy Markdown
Contributor

CHANGES:

  1. remove /lib/nodejs/lib/thrift/connection.js#L233-L236, it cause thrift cannot do reconnect
  2. add forceClose variable for indicating close action caseued by manual, and give up reconnecting

@Jens-G

Jens-G commented Jun 23, 2021

Copy link
Copy Markdown
Member

Anybody who could doublecheck this patch?

@wujjpp

wujjpp commented Sep 6, 2021

Copy link
Copy Markdown
Contributor Author

Anybody who could doublecheck this patch?

We have used this patch in production

@emmenlau emmenlau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally looks good, but I'm no expert in this. Also, the same change may be needed in other Javascript-implementations?

Comment thread lib/nodejs/lib/thrift/connection.js Outdated

// If closed by manual, emit close event and cancel reconnect process
if(this.forceClose) {
self.emit("close");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This may be overly pedantic, but would it be better to first clear the timer and then emit close? In other words, move the line self.emit("close"); down below the if (this.retry_timer) { block?

@wujjpp wujjpp Dec 2, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, close event handler maybe cause panic.
I have updated this change

@stale

stale Bot commented Apr 16, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix label Apr 16, 2022
@emmenlau

Copy link
Copy Markdown
Member

Generally looks good to me. Could you kindly rebase on latest master and push again?

@stale

stale Bot commented Apr 16, 2022

Copy link
Copy Markdown

This issue is no longer stale. Thank you for your contributions.

@stale stale Bot removed the wontfix label Apr 16, 2022
wujjpp and others added 2 commits May 25, 2022 15:48
@wujjpp

wujjpp commented May 25, 2022

Copy link
Copy Markdown
Contributor Author

@emmenlau rebased on latest master and pushed

@Jens-G
Jens-G merged commit 22aa3e5 into apache:master Oct 25, 2022
@wujjpp
wujjpp deleted the thrift-nodejs-reconnect-issue branch October 26, 2022 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants