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

errorprone :: ThreadPriorityCheck #994

Merged
merged 2 commits into from
Oct 23, 2024
Merged
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
3 changes: 2 additions & 1 deletion src/main/java/emissary/core/MobileAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public MobileAgent() {
* @param threadGroup group we operate it
* @param threadName symbolic name for this agent thread
*/
@SuppressWarnings("ThreadPriorityCheck")
public MobileAgent(final ThreadGroup threadGroup, final String threadName) {
logger.debug("Constructing agent {}", threadName);
this.thread = new Thread(threadGroup, this, threadName);
Expand Down Expand Up @@ -180,7 +181,7 @@ public void killAgent() {
* Kill asynchronously
*/
@Override
@SuppressWarnings("Interruption")
@SuppressWarnings({"Interruption", "ThreadPriorityCheck"})
public void killAgentAsync() {
logger.debug("killAgentAsync called on {}", getName());
this.timeToQuit = true;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/core/ResourceWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public ResourceWatcher() {
/**
* Create a resource watcher set it running and bind into the NamespaceException
*/
@SuppressWarnings("ThreadPriorityCheck")
public ResourceWatcher(final MetricsManager metricsManager) {
this.metrics = metricsManager.getMetricRegistry();
final Thread thread = new Thread(this, "ResourceWatcher");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/core/sentinel/Sentinel.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class Sentinel implements Runnable {
/**
* Create a Sentinel - set it running and bind into the {@link Namespace}
*/
@SuppressWarnings("ThreadPriorityCheck")
public Sentinel() {
configure();
if (this.enabled) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/pickup/PickUpPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ public void assignToPooledAgent(IBaseDataObject payload, long timeoutMs) throws
* @return mobile agent assigned to pool
* @throws EmissaryException when an agent cannot be obtained
*/
@SuppressWarnings("ThreadPriorityCheck")
public static IMobileAgent assignToPooledAgent(IBaseDataObject payload, @Nullable AgentPool agentPool, IServiceProviderPlace startingLocation,
long timeoutMs) throws EmissaryException {
IMobileAgent agent = null;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/emissary/pickup/QueServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public QueServer(IPickUpSpace space, PickupQueue queue, long pollingInterval) {
* @param pollingInterval value in millis
* @param name value to supply to Thread name
*/
@SuppressWarnings("ThreadPriorityCheck")
public QueServer(IPickUpSpace space, PickupQueue queue, long pollingInterval, String name) {
super(name);
this.space = space;
Expand Down Expand Up @@ -116,6 +117,7 @@ public void run() {
/**
* Check the queue for waiting objects and process them
*/
@SuppressWarnings("ThreadPriorityCheck")
public void checkQue() {
WorkBundle paths = queue.deque();
while (paths != null) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/pickup/file/FileDataServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class FileDataServer extends Pausable {
* @param parent the FPP that created me
* @param pollingInterval how often to check for new files in millis
*/
@SuppressWarnings("ThreadPriorityCheck")
public FileDataServer(String inputDataDirectory, FilePickUpPlace parent, long pollingInterval) {

// Name the thread
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/pickup/file/FilePickUpPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public boolean isPaused() {
/**
* For each input directory start a new server thread.
*/
@SuppressWarnings("ThreadPriorityCheck")
public void startDataServer() {
for (int i = 0; i < inputDataDirs.length; i++) {
FileDataServer fds = new FileDataServer(inputDataDirs[i], this, pollingInterval);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/emissary/pool/MoveSpool.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public MoveSpool() {
/**
* Configure stuff
*/
@SuppressWarnings("ThreadPriorityCheck")
private void configure() {
// Get the agent pool
resetPool();
Expand Down Expand Up @@ -139,6 +140,7 @@ private IDirectoryPlace getLocalDirectory() {
* Run the thread to watch the spool
*/
@Override
@SuppressWarnings("ThreadPriorityCheck")
public void run() {
int consecutiveSendCounter = 0;

Expand Down
1 change: 1 addition & 0 deletions src/test/java/emissary/test/core/junit5/UnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ protected List<String> getMyXmlResources() {
*
* @param millis how long to pause
*/
@SuppressWarnings("ThreadPriorityCheck")
protected void pause(long millis) {
Thread.yield();
try {
Expand Down