Skip to content
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

Fix hang in nodejs etl on mysql connection failure. #1477

Merged
merged 5 commits into from
Jan 20, 2021

Conversation

jpwhite4
Copy link
Member

@jpwhite4 jpwhite4 commented Jan 5, 2021

Description

By code inspection there is a possible hang condition if
the mysql connection fails in the ETL logging part of the
code.

Tests performed

I tested this code change manually by editing the etl_profile and
temporarily editing the mysql configuration so that the connection
would fail:

mysqlConfig.host = 'qweqw';

The output of the process was then:

2021-01-05T21:13:39.077Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.077Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.083Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.161Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.172Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}

and then the process exited. Without the bug fix the output looks like this:

2021-01-05T21:15:14.519Z - error: undefined
2021-01-05T21:15:14.547Z - error: undefined
2021-01-05T21:15:14.555Z - error: undefined
2021-01-05T21:15:14.608Z - error: undefined
2021-01-05T21:15:14.615Z - error: undefined

and the process hangs forever.

By code inspection there is a possible hang condition if
the mysql connection fails in the ETL logging part of the
code.

I tested this code change manually by editing the etl_profile and
temporarily editing the mysql configuration so that the connection
would fail:

mysqlConfig.host = 'qweqw';

The output of the process was then:
```
2021-01-05T21:13:39.077Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.077Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.083Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.161Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
2021-01-05T21:13:39.172Z - error: {"code":"ENOTFOUND","errno":"ENOTFOUND","syscall":"getaddrinfo","hostname":"qweqw","host":"qweqw","port":"3306","fatal":true}
```
and then the process exited. Without the bug fix the output looks like this:
```
2021-01-05T21:15:14.519Z - error: undefined
2021-01-05T21:15:14.547Z - error: undefined
2021-01-05T21:15:14.555Z - error: undefined
2021-01-05T21:15:14.608Z - error: undefined
2021-01-05T21:15:14.615Z - error: undefined
```
and the process hangs forever.
@jpwhite4 jpwhite4 added bug Bugfixes Category:ETL Extract Transform Load labels Jan 5, 2021
@jpwhite4 jpwhite4 added this to the 9.5.0 milestone Jan 5, 2021
@jpwhite4 jpwhite4 requested a review from jtpalmer January 5, 2021 21:25
@jpwhite4 jpwhite4 merged commit c2a1070 into ubccr:xdmod9.5 Jan 20, 2021
@jpwhite4 jpwhite4 deleted the hang branch January 20, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes Category:ETL Extract Transform Load
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants