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

optimize: gracefully close resources #2139

Merged
merged 21 commits into from
Jan 10, 2020
Merged

Conversation

funky-eyes
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jan 4, 2020

Codecov Report

Merging #2139 into develop will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2139      +/-   ##
=============================================
- Coverage       54.4%   54.38%   -0.02%     
+ Complexity      2469     2467       -2     
=============================================
  Files            445      445              
  Lines          14742    14742              
  Branches        1734     1734              
=============================================
- Hits            8020     8018       -2     
  Misses          5963     5963              
- Partials         759      761       +2
Impacted Files Coverage Δ Complexity Δ
...ava/io/seata/core/constants/ConfigurationKeys.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...in/java/io/seata/server/session/GlobalSession.java 84.13% <0%> (-0.49%) 67% <0%> (-1%)
...o/seata/server/coordinator/DefaultCoordinator.java 47.26% <0%> (-0.4%) 27% <0%> (-1%)

ByteArrayOutputStream baos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(baos);
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos)) {
Copy link
Member

Choose a reason for hiding this comment

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

The close method of ByteArrayOutputStream actually does nothing.The close method of ObjectOutputStream should be called.

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

I left some comments.

@funky-eyes
Copy link
Contributor Author

I left some comments.

PTAL

@zjinlei zjinlei changed the title gracefully close resources optimize: gracefully close resources Jan 10, 2020
Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@xingfudeshi xingfudeshi merged commit 400dc5b into apache:develop Jan 10, 2020
funky-eyes added a commit to funky-eyes/seata that referenced this pull request Jan 11, 2020
optimize: gracefully close resources (apache#2139)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(baos);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
Copy link
Member

Choose a reason for hiding this comment

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

if ObjectOutputStream close error , it will throw an exception?

dangquocbang pushed a commit to dangquocbang/seata that referenced this pull request Jan 14, 2020
* 'develop' of https://github.com/seata/seata: (125 commits)
  optimize: tcc module code style (apache#2103)
  refactor: change the package path of MySQL recognizer (apache#2125)
  optimize: fix query typo (apache#2176)
  refactor: add sql parser type druid as constant (apache#2156)
  test: enhance test coverage of seata common (apache#2170)
  optimize: gracefully close resources (apache#2139)
  Feature: Saga provide a switch to skip branch report on branch success, in order to optimize performance. (apache#2151)
  chore:use serializer instead of codec (apache#2097)
  optimize: spring module code style (apache#2159)
  optimize: Add Dubbo compatibility (apache#2036)
  optimize : seata-rm-datasource module code style (apache#2062)
  bugfix: Saga report branch status incorrect when service retried succeed (apache#2145)
  optimize:optimize log specifications (apache#2146)
  bugfix: when branchRollback failed, it will trigger retry of multi-tc. (apache#2113)
  refactor: create sql parser spi and a druid type sql parser (apache#1703)
  refactor: simplify to make seata-common more readable (apache#2038)
  feature: support FastThreadLocalContextCore (apache#2106)
  optimize: some typos (apache#2120)
  optimize: increase the oracle table meta cache code coverage (apache#2078)
  optimize: some typos (apache#2115)
  ...

# Conflicts:
#	pom.xml
@slievrly slievrly added this to the 1.1.0 milestone Feb 3, 2020
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.

None yet

6 participants