This commit is contained in:
@@ -9,7 +9,7 @@ Problem:
|
|||||||
|
|
||||||
potential fixes: TODO HERE:
|
potential fixes: TODO HERE:
|
||||||
Detect postgres is unreachable and stop digging a hole, wait to resolve it before continuing on again
|
Detect postgres is unreachable and stop digging a hole, wait to resolve it before continuing on again
|
||||||
|
|
||||||
Don't log same message repeatedly
|
Don't log same message repeatedly
|
||||||
actually this is not necessary if just stop running jobs when can't reach sql server
|
actually this is not necessary if just stop running jobs when can't reach sql server
|
||||||
FIXED don't dual log to system journal logs and ayanova log
|
FIXED don't dual log to system journal logs and ayanova log
|
||||||
@@ -40,6 +40,10 @@ Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
|||||||
System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
|
System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
|
||||||
System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
||||||
|
|
||||||
|
ex.source "Npgsql.EntityFrameworkCore.PostgreSQL","Npgsql"
|
||||||
|
ex.message "An exception has been raised that is likely due to a transient failure.","Exception while writing to stream","Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.."
|
||||||
|
|
||||||
|
|
||||||
Boot exception when db is not up:
|
Boot exception when db is not up:
|
||||||
{Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
{Npgsql.NpgsqlException (0x80004005): Failed to connect to 127.0.0.1:5432
|
||||||
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
||||||
|
|||||||
@@ -239,20 +239,10 @@ namespace AyaNova.Util
|
|||||||
internal static void HandleIfDatabaseUnavailableTypeException(Exception ex)
|
internal static void HandleIfDatabaseUnavailableTypeException(Exception ex)
|
||||||
{
|
{
|
||||||
if (ex == null) return;
|
if (ex == null) return;
|
||||||
//System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
|
if (ex.Message.Contains("transient failure") && ex.Source.Contains("PostgreSQL"))
|
||||||
//System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
|
ServerGlobalOpsSettingsCache.DBAVAILABLE = false;
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (ex.Message.Contains("SOMESTRING"))
|
|
||||||
{
|
|
||||||
ServerGlobalOpsSettingsCache.DBAVAILABLE = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ex = ex.InnerException;
|
|
||||||
//ServerGlobalOpsSettingsCache.DBAVAILABLE = true;
|
|
||||||
} while (ex != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
//Verify that database exists, if not, then create it
|
//Verify that database exists, if not, then create it
|
||||||
|
|||||||
Reference in New Issue
Block a user