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(connection): ensure pooled connections get released #1666

Merged

Conversation

tommarien
Copy link
Contributor

@tommarien tommarien commented Nov 5, 2022

The PoolConnection is listening for the end event to be emitted to close the connection, but the connection is not listening to the underlying end event emitted by the net.Socket.

fixes #1664

The PoolConnection is listening for the end event to be emitted to close
the connection, but the connection is not listening to the underlying
end event emitted by the net.Socket.
@tommarien tommarien force-pushed the fix/emit-end-if-stream-receives-end branch from 8276221 to ac78e29 Compare November 5, 2022 22:51
@tommarien
Copy link
Contributor Author

@sidorares anything i can help on the github.GithubException.GithubException: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/reference/issues#create-an-issue-comment"} ?

@tommarien
Copy link
Contributor Author

@sidorares is it because coverage regressed by it, i can try to put up an integration test that verifies the behavior ?

@sidorares
Copy link
Owner

I believe coverage fails because of the autogenerated access token permissions preventing it from posting coverage report when initiator is external repo, so its usually a false positive. I should really try to fix that or disable workflow. Please ignore it for now ( But if you can integration test would be really really great )

@tommarien
Copy link
Contributor Author

tommarien commented Nov 8, 2022

Will try later tonight or tomorrow to add an integration test for it thanks for the update @sidorares

@tommarien tommarien force-pushed the fix/emit-end-if-stream-receives-end branch from f336d5f to 2dfee95 Compare November 8, 2022 22:30
@sidorares sidorares added this to the 3.0.0 milestone Nov 11, 2022
@sidorares sidorares merged commit 7b6f5c4 into sidorares:master Dec 4, 2022
@tommarien tommarien deleted the fix/emit-end-if-stream-receives-end branch December 5, 2022 08:21
@tommarien
Copy link
Contributor Author

@sidorares Thanks for merging, are you going for another rc or is the 3.0.0 planned in the coming weeks ?

@sidorares
Copy link
Owner

Yes, I'll push rc hopefully in the next couple of days. Unfortunately release-please not ready yet, otherwise I'd do releases more frequently

@tommarien
Copy link
Contributor Author

@sidorares Ok thanks 🙏

@tommarien
Copy link
Contributor Author

Hi @sidorares, any chance you could release a new rc beginning of januari, we want to test drive it in our enviroments ?

@tommarien
Copy link
Contributor Author

@sidorares Do you have any update on this? Sorry to bother you again with this, but the issue is really blocking us, and we need to move forward, but i would like to prevent forking etc ;)

daniellockyer added a commit to TryGhost/Ghost that referenced this pull request Jan 12, 2023
fixes #14990

- there was a bug in `mysql2` [1] when connecting to Azure DBs, but this was
  subsequently fixed, so this commit bumps the package in Ghost and
  `knex-migrator`, where this was also bumped
- of note, this release includes sidorares/node-mysql2#1666 and
  sidorares/node-mysql2#1751, which are very interesting

[1]: sidorares/node-mysql2#1438
Vylpes pushed a commit to Vylpes/Droplet that referenced this pull request Sep 14, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mysql2](https://github.com/sidorares/node-mysql2) | dependencies | major | [`^2.2.5` -> `^3.0.0`](https://renovatebot.com/diffs/npm/mysql2/2.2.5/3.2.4) |

---

### Release Notes

<details>
<summary>sidorares/node-mysql2</summary>

### [`v3.2.4`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;324-httpsgithubcomsidoraresnode-mysql2comparev323v324-2023-04-25)

[Compare Source](sidorares/node-mysql2@v3.2.3...v3.2.4)

##### Bug Fixes

-   **server:** Added missing encoding argument to server-handshake ([#&#8203;1976](sidorares/node-mysql2#1976)) ([a4b6b22](sidorares/node-mysql2@a4b6b22))

### [`v3.2.3`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;323-httpsgithubcomsidoraresnode-mysql2comparev322v323-2023-04-16)

[Compare Source](sidorares/node-mysql2@v3.2.2...v3.2.3)

##### Bug Fixes

-   **types:** add decimalNumbers to createConnection/createPool typings. fixes [#&#8203;1803](sidorares/node-mysql2#1803) ([#&#8203;1817](sidorares/node-mysql2#1817)) ([bb48462](sidorares/node-mysql2@bb48462))

### [`v3.2.2`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;322-httpsgithubcomsidoraresnode-mysql2comparev321v322-2023-04-16)

[Compare Source](sidorares/node-mysql2@v3.2.1...v3.2.2)

##### Bug Fixes

-   `ConnectionOptions` conflict between `mysql` and `mysql/promise` ([#&#8203;1955](sidorares/node-mysql2#1955)) ([eca8bda](sidorares/node-mysql2@eca8bda))

### [`v3.2.1`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;321-httpsgithubcomsidoraresnode-mysql2comparev320v321-2023-04-13)

[Compare Source](sidorares/node-mysql2@v3.2.0...v3.2.1)

##### Bug Fixes

-   Add typings for Connection.promise(). ([#&#8203;1949](sidorares/node-mysql2#1949)) ([e3ca310](sidorares/node-mysql2@e3ca310))
-   PoolConnection redundancy when extending Connection interface in TypeScript ([7c62d11](sidorares/node-mysql2@7c62d11))

### [`v3.2.0`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;320-httpsgithubcomsidoraresnode-mysql2comparev312v320-2023-03-03)

[Compare Source](sidorares/node-mysql2@v3.1.2...v3.2.0)

##### Features

-   maxVersion ssl option to tls.createSecureContext ([0c40ef9](sidorares/node-mysql2@0c40ef9))

### [`v3.1.2`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;312-httpsgithubcomsidoraresnode-mysql2comparev311v312-2023-02-08)

[Compare Source](sidorares/node-mysql2@v3.1.1...v3.1.2)

##### Bug Fixes

-   update `lru-cache` reset method to clear ([114f266](sidorares/node-mysql2@114f266))

### [`v3.1.1`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;311-httpsgithubcomsidoraresnode-mysql2comparev310v311-2023-02-07)

[Compare Source](sidorares/node-mysql2@v3.1.0...v3.1.1)

##### Bug Fixes

-   remove accidental log in caching_sha2\_password.js ([c1202b6](sidorares/node-mysql2@c1202b6))

### [`v3.1.0`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;310-httpsgithubcomsidoraresnode-mysql2comparev301v310-2023-01-30)

[Compare Source](sidorares/node-mysql2@v3.0.1...v3.1.0)

##### Features

-   cleanup buffer/string conversions in hashing/xor helpers that were failing in Bun ([a2392e2](sidorares/node-mysql2@a2392e2))

##### Bug Fixes

-   when port is pased as a string convert it to a number (Bun's net.connect does not automatically convert this) ([703ecb2](sidorares/node-mysql2@703ecb2))

### [`v3.0.1`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;301-httpsgithubcomsidoraresnode-mysql2comparev300v301-2023-01-13)

[Compare Source](sidorares/node-mysql2@v3.0.0...v3.0.1)

##### Miscellaneous Chores

-   release 3.0.1 ([d5a6b2c](sidorares/node-mysql2@d5a6b2c))

### [`v3.0.0`](https://github.com/sidorares/node-mysql2/blob/HEAD/Changelog.md#&#8203;300-httpsgithubcomsidoraresnode-mysql2comparev300-rc1v300-2023-01-12)

[Compare Source](sidorares/node-mysql2@v2.3.3...v3.0.0)

-   named-placeholders library is updated to use newer `lru-cache` dependency, allowing it do dedupe and be shared between mysql2 and named-placeholders - sidorares/node-mysql2#1711, mysqljs/named-placeholders#19
-   `chai` and `mocha` moved to devDependencies [#&#8203;1774](sidorares/node-mysql2#1774)
-   Amazon RDS ssl certificates updated including AWS China [#&#8203;1754](sidorares/node-mysql2#1754)
-   `TCP_NODELAY` flag enabled, avoiding long connect timeout in some scenarios [#&#8203;1751](sidorares/node-mysql2#1751)
-   typing improvements: [#&#8203;1675](sidorares/node-mysql2#1675), [#&#8203;1674](sidorares/node-mysql2#1674)
-   fix:  ensure pooled connections get released [#&#8203;1666](sidorares/node-mysql2#1666)

##### Miscellaneous Chores

-   release 3.0.0 ([11692b2](sidorares/node-mysql2@11692b2))

### [`v2.3.3`](sidorares/node-mysql2@v2.3.2...v2.3.3)

[Compare Source](sidorares/node-mysql2@v2.3.2...v2.3.3)

### [`v2.3.2`](sidorares/node-mysql2@v2.3.1...v2.3.2)

[Compare Source](sidorares/node-mysql2@v2.3.1...v2.3.2)

### [`v2.3.1`](sidorares/node-mysql2@v2.3.0...v2.3.1)

[Compare Source](sidorares/node-mysql2@v2.3.0...v2.3.1)

### [`v2.3.0`](sidorares/node-mysql2@v2.2.5...v2.3.0)

[Compare Source](sidorares/node-mysql2@v2.2.5...v2.3.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9-->

Co-authored-by: Renovate Bot <renovate@vylpes.com>
Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/Droplet/pulls/128
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: RenovateBot <renovate@vylpes.com>
Co-committed-by: RenovateBot <renovate@vylpes.com>
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.

TypeOrm: This socket has been ended by the other party
2 participants