Skip to content

add Method to remove Workspaces#21

Open
KaiTries wants to merge 3 commits intoCArtAgO-lang:masterfrom
KaiTries:DeletingWorkspaces
Open

add Method to remove Workspaces#21
KaiTries wants to merge 3 commits intoCArtAgO-lang:masterfrom
KaiTries:DeletingWorkspaces

Conversation

@KaiTries
Copy link

@KaiTries KaiTries commented Jul 2, 2024

There was currently no way to remove workspaces so I added a method.

Method could also return void, but I prefer to be able to differentiate between actually removing something or doing nothing because the workspace is not there.

Additionally I noticed, that when a Workspace is shutdown through the .shutdown() method it will (catch) but log many exceptions like this:

java.lang.InterruptedException
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1722)
        at java.base/java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:420)
        at cartago.Workspace$EnvironmentController.run(Workspace.java:1949)
[ENV] [ENV-CONTROLLER] uncaught operation exception: java.lang.InterruptedException

This is because the shutdown() method calls the stopActivity() method in the EnvironmentController of the workspace. Which interrupts the thread. and the run() method of the Environment Controller is set to log all exceptions. I just added a case for when it is an instance of InterruptedException and isStopped() return true it will not log anything, because it works as expected.

@KaiTries KaiTries force-pushed the DeletingWorkspaces branch from a783cca to 6252712 Compare July 15, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant