aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:20:28 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:20:28 +0200
commit9612aae885bd2247455163531e853576b4caebd6 (patch)
tree8870d405f13c217bcf9145bf68104b9a533a278e
parentcec6db62af51a43e4c121f135a98de443ef0cd2c (diff)
parentd67ac798f10254d038c49244e7f1e2323afdfdfc (diff)
downloadjgit-9612aae885bd2247455163531e853576b4caebd6.tar.gz
jgit-9612aae885bd2247455163531e853576b4caebd6.zip
Merge branch 'stable-5.13' into stable-6.0
* stable-5.13: Remove stray files (probes or lock files) created by background threads Change-Id: I7af1355a77f14995118145162f6bb8a4f1755f2b
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java12
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java5
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java31
3 files changed, 39 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
index 509935dfb9..7eab1dcb09 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
@@ -200,4 +200,16 @@ public class LockFileTest extends RepositoryTestCase {
assertFalse(lock.isLocked());
checkFile(f, "contentother");
}
+
+ @Test
+ public void testUnlockNoop() throws Exception {
+ File f = writeTrashFile("somefile", "content");
+ try {
+ LockFile lock = new LockFile(f);
+ lock.unlock();
+ lock.unlock();
+ } catch (Throwable e) {
+ fail("unlock should be noop if not locked at all.");
+ }
+ }
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
index 7b5f00e4fe..2443c4e771 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java
@@ -216,9 +216,10 @@ public class FileBasedConfig extends StoredConfig {
}
final LockFile lf = new LockFile(getFile());
- if (!lf.lock())
- throw new LockFailedException(getFile());
try {
+ if (!lf.lock()) {
+ throw new LockFailedException(getFile());
+ }
lf.setNeedSnapshotNoConfig(true);
lf.write(out);
if (!lf.commit())
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
index 9237c0a9b2..e8f38d8fd9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
@@ -47,7 +47,6 @@ import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
@@ -262,8 +261,9 @@ public abstract class FS {
*
* @see java.util.concurrent.Executors#newCachedThreadPool()
*/
- private static final Executor FUTURE_RUNNER = new ThreadPoolExecutor(0,
- 5, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
+ private static final ExecutorService FUTURE_RUNNER = new ThreadPoolExecutor(
+ 0, 5, 30L, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<Runnable>(),
runnable -> {
Thread t = new Thread(runnable,
"JGit-FileStoreAttributeReader-" //$NON-NLS-1$
@@ -285,8 +285,9 @@ public abstract class FS {
* small keep-alive time to avoid delays on shut-down.
* </p>
*/
- private static final Executor SAVE_RUNNER = new ThreadPoolExecutor(0, 1,
- 1L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(),
+ private static final ExecutorService SAVE_RUNNER = new ThreadPoolExecutor(
+ 0, 1, 1L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>(),
runnable -> {
Thread t = new Thread(runnable,
"JGit-FileStoreAttributeWriter-" //$NON-NLS-1$
@@ -296,6 +297,18 @@ public abstract class FS {
return t;
});
+ static {
+ // Shut down the SAVE_RUNNER on System.exit()
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+ try {
+ SAVE_RUNNER.shutdownNow();
+ SAVE_RUNNER.awaitTermination(100, TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ // Ignore; we're shutting down
+ }
+ }));
+ }
+
/**
* Whether FileStore attributes should be determined asynchronously
*
@@ -452,11 +465,13 @@ public abstract class FS {
return null;
}
// fall through and return fallback
- } catch (IOException | InterruptedException
- | ExecutionException | CancellationException e) {
+ } catch (IOException | ExecutionException | CancellationException e) {
LOG.error(e.getMessage(), e);
} catch (TimeoutException | SecurityException e) {
// use fallback
+ } catch (InterruptedException e) {
+ LOG.error(e.getMessage(), e);
+ Thread.currentThread().interrupt();
}
LOG.debug("{}: use fallback timestamp resolution for directory {}", //$NON-NLS-1$
Thread.currentThread(), dir);
@@ -474,6 +489,7 @@ public abstract class FS {
Path probe = dir.resolve(".probe-" + UUID.randomUUID()); //$NON-NLS-1$
Instant end = Instant.now().plusSeconds(3);
try {
+ probe.toFile().deleteOnExit();
Files.createFile(probe);
do {
n++;
@@ -540,6 +556,7 @@ public abstract class FS {
}
Path probe = dir.resolve(".probe-" + UUID.randomUUID()); //$NON-NLS-1$
try {
+ probe.toFile().deleteOnExit();
Files.createFile(probe);
Duration fsResolution = getFsResolution(s, dir, probe);
Duration clockResolution = measureClockResolution();
ption> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/l10n/vi/files_external.po
blob: 793c09be9d014a80d446075775a1270ad60aff27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
#   <mattheu_9x@yahoo.com>, 2012.
# Sơn Nguyễn <sonnghit@gmail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2012-10-27 00:01+0200\n"
"PO-Revision-Date: 2012-10-26 13:46+0000\n"
"Last-Translator: mattheu_9x <mattheu_9x@yahoo.com>\n"
"Language-Team: Vietnamese (http://www.transifex.com/projects/p/owncloud/language/vi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: vi\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: js/dropbox.js:7 js/dropbox.js:25 js/google.js:7 js/google.js:23
msgid "Access granted"
msgstr "Đã cấp quyền truy cập"

#: js/dropbox.js:28 js/dropbox.js:74 js/dropbox.js:79 js/dropbox.js:86
msgid "Error configuring Dropbox storage"
msgstr "Lỗi cấu hình lưu trữ Dropbox "

#: js/dropbox.js:34 js/dropbox.js:45 js/google.js:31 js/google.js:40
msgid "Grant access"
msgstr "Cấp quyền truy cập"

#: js/dropbox.js:73 js/google.js:72
msgid "Fill out all required fields"
msgstr "Điền vào tất cả các trường bắt buộc"

#: js/dropbox.js:85
msgid "Please provide a valid Dropbox app key and secret."
msgstr ""

#: js/google.js:26 js/google.js:73 js/google.js:78
msgid "Error configuring Google Drive storage"
msgstr "Lỗi cấu hình lưu trữ Google Drive"

#: templates/settings.php:3
msgid "External Storage"
msgstr "Lưu trữ ngoài"

#: templates/settings.php:7 templates/settings.php:19
msgid "Mount point"
msgstr "Điểm gắn"

#: templates/settings.php:8
msgid "Backend"
msgstr "phụ trợ"

#: templates/settings.php:9
msgid "Configuration"
msgstr "Cấu hình"

#: templates/settings.php:10
msgid "Options"
msgstr "Tùy chọn"

#: templates/settings.php:11
msgid "Applicable"
msgstr "Áp dụng"

#: templates/settings.php:23
msgid "Add mount point"
msgstr "Thêm điểm lắp"

#: templates/settings.php:54 templates/settings.php:62
msgid "None set"
msgstr "không"

#: templates/settings.php:63
msgid "All Users"
msgstr "Tất cả người dùng"

#: templates/settings.php:64
msgid "Groups"
msgstr "Nhóm"

#: templates/settings.php:69
msgid "Users"
msgstr "Người dùng"

#: templates/settings.php:77 templates/settings.php:107
msgid "Delete"
msgstr "Xóa"

#: templates/settings.php:87
msgid "Enable User External Storage"
msgstr "Kích hoạt tính năng lưu trữ ngoài"

#: templates/settings.php:88
msgid "Allow users to mount their own external storage"
msgstr "Cho phép người dùng kết nối với lưu trữ riêng bên ngoài của họ"

#: templates/settings.php:99
msgid "SSL root certificates"
msgstr "Chứng chỉ SSL root"

#: templates/settings.php:113
msgid "Import Root Certificate"
msgstr "Nhập Root Certificate"