Skip to content

Commit

Permalink
Backporting for 2.492.2 LTS (#10276)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisstern authored Feb 19, 2025
2 parents 586fbb3 + a83fa43 commit b6691e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/hudson/util/AtomicFileWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.AccessDeniedException;
import java.nio.file.AtomicMoveNotSupportedException;
import java.nio.file.Files;
import java.nio.file.InvalidPathException;
Expand Down Expand Up @@ -246,11 +247,11 @@ private static void move(Path source, Path destination) throws IOException {
// Both files are on the same filesystem, so this should not happen.
LOGGER.log(Level.WARNING, e, () -> "Atomic move " + source + " → " + destination + " not supported. Falling back to non-atomic move.");
atomicMoveSupported = false;
} catch (AccessDeniedException e) {
LOGGER.log(Level.INFO, e, () -> "Move " + source + " → " + destination + " failed, perhaps due to a temporary file lock. Falling back to non-atomic move.");
}
}
if (!atomicMoveSupported) {
Files.move(source, destination, StandardCopyOption.REPLACE_EXISTING);
}
Files.move(source, destination, StandardCopyOption.REPLACE_EXISTING);
}

private static final class CleanupChecker implements Runnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:i="jelly:fmt">
<j:set target="${it}" property="nextBuildNumberToFetch" value="${it.nextBuildNumber}" />
<j:invokeStatic className="java.time.LocalDate" method="now" var="now" />
<j:if test="${h.isUserTimeZoneOverride()}">
<i:setTimeZone value="${h.getUserTimeZone()}" />
</j:if>
<j:new var="dateNow" className="java.util.Date"/>
<i:formatDate value="${dateNow}" var="now" type="date" pattern="YYYY-MM-dd"/>

<j:forEach var="pageEntry" items="${it.runs}">
<i:formatDate value="${pageEntry.entry.timestamp.time}" var="date" type="date" dateStyle="long" />
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/hudson/executors.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ THE SOFTWARE.
<td class="pane">
<div style="white-space: normal">
<j:choose>
<j:when test="${exeparent != null}">
<j:when test="${exe == null and exeparent != null }">
<j:choose>
<j:when test="${exeparentcanread}">
<a href="${rootURL}/${exeparent.url}"><l:breakable value="${exeparent.fullDisplayName}"/></a>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/layout/task/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Behaviour.specify("a.task-link-no-confirm", "task-link", 0, function (el) {
headers: crumb.wrap({}),
}).then((rsp) => {
if (rsp.ok) {
notificationBar(success, notificationBar.SUCCESS);
notificationBar.show(success, notificationBar.SUCCESS);
} else {
notificationBar(failure, notificationBar.ERROR);
notificationBar.show(failure, notificationBar.ERROR);
}
});
ev.preventDefault();
Expand Down

0 comments on commit b6691e8

Please sign in to comment.