-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move reconnect logic to main thread (#51)
* Move reconnect logic to the main thread * Retry on most exceptions * Add recoverable and unrecoverable exceptions * Add missing license headers * Improve logs on unknown exceptions
- Loading branch information
Showing
4 changed files
with
114 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/io/seqera/tower/agent/exceptions/RecoverableException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2021, Seqera Labs. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* This Source Code Form is "Incompatible With Secondary Licenses", as | ||
* defined by the Mozilla Public License, v. 2.0. | ||
*/ | ||
|
||
package io.seqera.tower.agent.exceptions; | ||
|
||
/** | ||
* A recoverable exception is an exception that Tower Agent will log as | ||
* an error, but it will keep running and retrying to connect. | ||
*/ | ||
public class RecoverableException extends RuntimeException { | ||
|
||
public RecoverableException() { | ||
} | ||
|
||
public RecoverableException(String message) { | ||
super(message); | ||
} | ||
|
||
public RecoverableException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/io/seqera/tower/agent/exceptions/UnrecoverableException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2021, Seqera Labs. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* This Source Code Form is "Incompatible With Secondary Licenses", as | ||
* defined by the Mozilla Public License, v. 2.0. | ||
*/ | ||
|
||
package io.seqera.tower.agent.exceptions; | ||
|
||
/** | ||
* An unrecoverable exception is an exception that Tower Agent will log as | ||
* an error and cause it to exit with an exit code error. | ||
*/ | ||
public class UnrecoverableException extends RuntimeException { | ||
|
||
public UnrecoverableException() { | ||
} | ||
|
||
public UnrecoverableException(String message) { | ||
super(message); | ||
} | ||
|
||
public UnrecoverableException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |