]> source.dussan.org Git - jgit.git/commit
LockFile: create OutputStream only when needed 32/180432/1
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 4 May 2021 21:48:56 +0000 (23:48 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 10 May 2021 21:58:07 +0000 (23:58 +0200)
commit00386272264f65c41e36406f7c2e9ea6e901276e
tree036edce7b7e5d41bdccba0a91bd147e3e3191bc5
parentc9d871f15d4daa4ab959b34d2a0759016e415643
LockFile: create OutputStream only when needed

Don't create the stream eagerly in lock(); that may cause JGit to
exceed OS or JVM limits on open file descriptors if many locks need
to be created, for instance when creating many refs. Instead create
the output stream only when one really needs to write something.

Bug: 573328
Change-Id: If9441ed40494d46f594a896d34a5c4f56f91ebf4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java