Skip to content

Commit 629d8d0

Browse files
committed
Merge r/17.x into r/18.x
2 parents 95cdf4e + a28c7e1 commit 629d8d0

File tree

7 files changed

+41
-14
lines changed

7 files changed

+41
-14
lines changed

.github/workflows/create-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ jobs:
5757
For further information, please take a look at:
5858
5959
- [Release notes](https://docs.opencast.org/r/${{ steps.get_version.outputs.VERSION_MAIN }}.x/admin/#releasenotes/#opencast-${{ steps.get_version.outputs.VERSION_COMBINED }})
60-
- [Changelog](https://docs.opencast.org/r/${{ steps.get_version.outputs.VERSION_MAIN }}.x/admin/#changelog/#opencast-${{ steps.get_version.outputs.VERSION_COMBINED }})
60+
- [Changelog](https://docs.opencast.org/r/${{ steps.get_version.outputs.VERSION_MAIN }}.x/admin/#changelog/opencast-${{ steps.get_version.outputs.VERSION_MAIN }})

assemblies/resources/bin/setenv

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,4 @@
4141
export EXTRA_JAVA_OPTS="${EXTRA_JAVA_OPTS} -Dorg.eclipse.jetty.server.Request.maxFormContentSize=1500000 -Dfile.encoding=UTF-8 -Dlog4j2.formatMsgNoLookups=true -Djava.awt.headless=true"
4242
export KARAF_NOROOT=true
4343

44-
# Mitigation for new Tesseract 4.x locking up the system
45-
export OMP_THREAD_LIMIT=1
46-
4744
. "$DIRNAME/check_ports"

docs/guides/admin/docs/installation/java-version.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This is a list of Opencast versions and the versions of OpenJDK they require:
55

66
| Opencast | Java |
77
|-------------|------|
8-
| ≥ 16.x | 17 |
8+
| ≥ 17.x | 21 |
9+
| 16.x - 17.x | 17 |
910
| 9.x - 16.x | 11 |
1011
| ≤ 9.x | 8 |

modules/asset-manager-storage-fs/src/main/java/org/opencastproject/assetmanager/storage/impl/fs/AbstractFileSystemAssetStore.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ public boolean contains(StoragePath path) throws AssetStoreException {
148148
@Override
149149
public boolean delete(DeletionSelector sel) throws AssetStoreException {
150150
File dir = getDeletionSelectorDir(sel);
151+
if (dir == null) {
152+
// MediaPackage could not be found locally. This could mean
153+
// - all snapshots live in a remote asset store
154+
// - mount failed and files are temporary not available
155+
// - file was deleted out-of-band
156+
// - other fs problem
157+
// In any case, we cannot continue and return "false" to indicate that the files could not be found.
158+
return false;
159+
}
151160
try {
152161
FileUtils.deleteDirectory(dir);
153162
// also delete the media package directory if all versions have been deleted
@@ -169,11 +178,14 @@ public boolean delete(DeletionSelector sel) throws AssetStoreException {
169178
*
170179
* @param sel
171180
* the deletion selector
172-
* @return the directory file
181+
* @return the directory file or null if it does not exist (e.g. MediaPackage does not exist locally)
173182
*/
174183
private File getDeletionSelectorDir(DeletionSelector sel) {
175-
final String basePath = path(getRootDirectory(sel.getOrganizationId(), sel.getMediaPackageId()),
176-
sel.getOrganizationId(), sel.getMediaPackageId());
184+
final String rootPath = getRootDirectory(sel.getOrganizationId(), sel.getMediaPackageId());
185+
if (rootPath == null) {
186+
return null;
187+
}
188+
final String basePath = path(rootPath, sel.getOrganizationId(), sel.getMediaPackageId());
177189
if (sel.getVersion().isPresent()) {
178190
return file(basePath, sel.getVersion().get().toString());
179191
}

modules/security-aai/src/main/java/org/opencastproject/security/aai/api/AttributeMapper.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,19 @@ public List<String> getMappedAttributes(
9090
Expression exp = null;
9191
try {
9292
exp = parser.parseExpression(expression);
93-
String res = (String) exp.getValue(sourceAttributes);
93+
Object res = exp.getValue(sourceAttributes);
9494
logger.debug("Mapping {} to {}", exp.getExpressionString(), res);
95-
if (res != null) {
96-
mappedAttributes.add(res);
95+
if (res == null) {
96+
continue;
97+
}
98+
if (res instanceof String) {
99+
mappedAttributes.add((String) res);
100+
} else if (res instanceof List<?>) {
101+
for (Object resListItem : (List<?>) res) {
102+
if (resListItem instanceof String) {
103+
mappedAttributes.add((String) resListItem);
104+
}
105+
}
97106
}
98107
} catch (Exception e) {
99108
logger.warn("Mapping for '{}' with expression {} exp.getExpressionString() failed: {}",

modules/textextractor-tesseract/src/main/java/org/opencastproject/textextractor/tesseract/TesseractTextExtractor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public List<String> extract(File image) throws TextExtractorException {
141141
try {
142142
ProcessBuilder processBuilder = new ProcessBuilder(command);
143143
processBuilder.redirectErrorStream(true);
144+
// Mitigation for new Tesseract 4.x spawning too many threads locking up the system. Limit to one thread.
145+
processBuilder.environment().put("OMP_THREAD_LIMIT", "1");
144146
Process tesseractProcess = processBuilder.start();
145147

146148
// listen to output

modules/userdirectory-studip/src/main/java/org/opencastproject/userdirectory/studip/StudipUserProviderInstance.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838
import com.google.common.util.concurrent.ExecutionError;
3939
import com.google.common.util.concurrent.UncheckedExecutionException;
4040

41+
import org.apache.http.client.config.RequestConfig;
4142
import org.apache.http.client.methods.CloseableHttpResponse;
4243
import org.apache.http.client.methods.HttpGet;
4344
import org.apache.http.client.utils.URIBuilder;
4445
import org.apache.http.impl.client.CloseableHttpClient;
45-
import org.apache.http.impl.client.HttpClients;
46+
import org.apache.http.impl.client.HttpClientBuilder;
4647
import org.json.simple.JSONArray;
4748
import org.json.simple.JSONObject;
4849
import org.json.simple.parser.JSONParser;
@@ -278,7 +279,7 @@ protected User loadUserFromStudip(String userName) {
278279
logger.error("Exception while parsing response from provider for user {}", userName, e);
279280
return null;
280281
} catch (IOException e) {
281-
logger.error(e.getMessage());
282+
logger.error("Error requesting user data for user `{}`: {}", userName, e.getMessage());
282283
return null;
283284
} catch (URISyntaxException e) {
284285
logger.error("Misspelled URI", e);
@@ -306,7 +307,12 @@ private JSONObject getStudipUser(String uid) throws URISyntaxException, IOExcept
306307
HttpGet get = new HttpGet(url);
307308
get.setHeader("User-Agent", OC_USERAGENT);
308309

309-
try (CloseableHttpClient client = HttpClients.createDefault()) {
310+
// Don't wait for responses indefinitely
311+
RequestConfig config = RequestConfig.custom()
312+
.setConnectTimeout(5000)
313+
.setSocketTimeout(10000).build();
314+
315+
try (CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).build();) {
310316
try (CloseableHttpResponse resp = client.execute(get)) {
311317
var statusCode = resp.getStatusLine().getStatusCode();
312318
if (statusCode == 404) {

0 commit comments

Comments
 (0)