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

Hotfix 1.6.x sup 13391 #1455

Open
wants to merge 2 commits into
base: hotfix-1.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions LTS-CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ include::content/docs/variables.adoc-include[]
The LTS changelog lists releases which are only accessible via a commercial subscription.
All fixes and changes in LTS releases will be released the next minor release. Changes from LTS 1.4.x will be included in release 1.5.0.

[[v1.6.36]]
== 1.6.36 (TBD)

icon:check[] OrientDB: previously when a backup was in progress all requests would fail with a 500 status code as an internal error. This has been changed to send a 503 status code with a descriptive message.

[[v1.6.35]]
== 1.6.35 (06.10.2022)

Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/i18n/translations_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ import_failed=Import fehlgeschlagen.

backup_finished=Backup abgeschlossen.
backup_failed=Backup fehlgeschlagen.
backup_in_progress=Zugriff auf Datenbank nicht m�glich, Backup l�uft.
backup_consistency_check_failed=Backup fehlgeschlagen. Der Konsistenzcheck hat {0} Inkonsistenzen gefunden.
backup_error_not_supported_in_memory_mode=Backup Operationen können nicht durchgeführt werden wenn der in-memory modus verwendet wird.

Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/i18n/translations_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ import_failed=Import failed.

backup_finished=Backup completed.
backup_failed=Backup failed.
backup_in_progress=Cannot access database, backup is in progress.
backup_consistency_check_failed=Backup failed. Consistency check found {0} inconsistencies.
backup_error_not_supported_in_memory_mode=Backup operation can not be run in memory mode.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.inject.Inject;
import javax.inject.Singleton;

import com.gentics.mesh.core.rest.error.BackupInProgressException;
import org.apache.commons.lang3.tuple.Triple;

import com.gentics.madl.tx.Tx;
Expand Down Expand Up @@ -561,6 +562,8 @@ private void checkStatus() {
case READY:
case STARTING:
return;
case BACKUP:
throw new BackupInProgressException();
default:
throw new RuntimeException("Mesh is not ready. Current status " + status.name() + ". Aborting transaction.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Abstract class for regular rest exceptions. This class should be used when returning the exception information via a JSON response.
*/
@JsonIgnoreProperties({ "suppressed", "cause", "detailMessage", "stackTrace", "localizedMessage" })
@JsonIgnoreProperties({ "suppressed", "cause", "detailMessage", "stackTrace", "localizedMessage", "logStackTrace" })
public abstract class AbstractRestException extends RuntimeException {

private static final long serialVersionUID = 2209919403583173663L;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.gentics.mesh.core.rest.error;

import io.netty.handler.codec.http.HttpResponseStatus;

/**
* This exception should be thrown when the database is not available due to a backup.
*/
public class BackupInProgressException extends AbstractRestException {

private static final String TYPE = "backup_in_progress";

public BackupInProgressException() {
super(HttpResponseStatus.SERVICE_UNAVAILABLE, "backup_in_progress");
}

@Override
public String getType() {
return TYPE;
}
}