Skip to content

Conversation

@mernst
Copy link
Contributor

@mernst mernst commented Apr 8, 2023

In CommonsCompressAction.execute(), if an exception occurs during the call to new BufferedOutputStream or createCompressorOutputStream, then the FileOutputStream is never closed and a resource leak occurs. This patch refactors the code so that the FileOutputStream is always closed.

@vy vy self-assigned this Apr 10, 2023
mernst and others added 3 commits April 10, 2023 12:36
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
@mernst
Copy link
Contributor Author

mernst commented Apr 10, 2023

@vy Thanks for the suggestions

@vy vy merged commit d33bc3c into apache:2.x Apr 11, 2023
@vy
Copy link
Member

vy commented Apr 11, 2023

Thanks so much for the contributions @mernst, much appreciated! 😍

@mernst mernst deleted the close-resource branch April 11, 2023 17:08
rgoers added a commit that referenced this pull request May 16, 2023
* Interim commit

* More fixes

* Everything builds

* Fix `PatternLayout.Builder#withHeader()` javadoc (#1411)

* Fix `SimpleDateFormat`-related JDK bug URL in `FastDateParser` javadoc (#1404)

* Ensure `FileOutputStream` is closed in `CommonsCompressAction.execute()` (#1415)

* Fix nullability docs in `StrSubstitutor` (#1422)

* Change `{@literal null}` to `{@code null}` (#1424)

* Remove deprecated docs from `PatternParser#extractConverter()` (#1423)

* Bump actions/checkout from 3.4.0 to 3.5.2 (#1434)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@24cb908...8e5e7e5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/setup-python from 4.3.0 to 4.6.0 (#1440)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.3.0 to 4.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@13ae5bb...57ded4d)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* LOG4J2-3660 Fix `%notEmpty` for empty MDC/NDC inputs

* LOG4J2-3660 Add `MdcPatternConverter` fixes missing from the cherry-pick

* Prepare for formatting of all files

Sometimes Spotless will not detect that a header already exists, e.g. if
it is after a package declaration.

* Apply Spotless

* Bump github/codeql-action from 2.1.28 to 2.3.1 (#1452)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.28 to 2.3.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@cc7986c...8662eab)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github/codeql-action from 2.3.1 to 2.3.2 (#1455)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@8662eab...f3feb00)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add Log4j Transform documentation

Adds a documentation page that forwards the user to Github.

* Fix license header

* Fix typo in `SECURITY.md` (#1457)

* Bump logging-parent from 8 to 9

By bumping to logging-parent 9, we remove the explicit Spotless
configuration.

* Rebase with main

* Trying to rebase from main

* Provide LoggerContext properties during configuration

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Michael Ernst <mernst@cs.washington.edu>
Co-authored-by: Michael Ernst <mernst@alum.mit.edu>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org>
Co-authored-by: spotless[bot] <robots@logging.apache.org>
Co-authored-by: Michael Scovetta <michael.scovetta@gmail.com>
theit pushed a commit to theit/logging-log4j2 that referenced this pull request May 30, 2023
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.

2 participants