Very nice article. Its exiting to see that Intersystems developers are taking advantage of the (great) Embedded Python feature in IRIS.

If you want to see a "real life" use case (we are using it for more than 2 years in our production environment), check this article: IRIS Embedded Python with Azure Service Bus (ASB) use case | InterSystems
(it also won the 1st place in an Intersystems article competition in 2022)
 

I would check the following:

1. Check the %SYS.Task class with SQL but also do an Integrity check, to see if there are any errors on those globals that hold that task manager data.

2. if the "corrupted"/"copied" task (with $h=0) is the one that consume 100% of CPU, I would try to "re-schedule" it to see if the new "next date" is set to something else. If not, to delete (you don't need to re-create it, looks like 1001 is a copy of 1000)

3. Monitor the 100% CPU task (SMP or JOBEXAM) to try to understand at what commands it's "stuck"