I know this topic has been discussed, but I have not seen any clear answer on it (point me to one if possibe). If you have an agent set to run in a mail file “After new mail arrives” it works fine on the home server of ther user who has signed the agent. But, every night sometime after midnight when the agent caceh is refreshed on the servers in the cluster, it causes the agent to run on the other servers in the cluster and act on documents that have already been acted upon by the agent when mail actually arrived in the home server.
This is an extermely serious problem, basically makes the agent type unusable in a cluster. I have tried a couple PMRs with IBM and may escalate this to a severity 1 issue if it cannot be solved. If anyone has come up with a way to fix this problem please let me know.
Subject: After New Mail Arrives Agents and clusters
Gabriel,
It’s a real issue, but there is no perfect solution. If your agents are set to run on Any Server, then you risk having them run more than once against same docs. If they’re set to run on only the primary server, then you risk having them run not at all, if mail is routed to the backup server.
Subject: RE: After New Mail Arrives Agents and clusters
do you write to the mail document to set field variables “before mail arrives” And is there a UNID for the mail “before mail arrives” If you would share a portion of your code for this agent that demonstrates getting a handle on the mail document and setting field values, I would very much appreciate it.
Subject: After New Mail Arrives Agents and clusters
Just an fyi…
Becareful with this type of agent…
If you make a new copy of a mail database with an agent like this enabled, it will send out e-mails to ALL users who have sent mail to this database. This could be a disaster depending who the user is, like the CIO. If he/she had 10,000 e-mails sitting in the inbox when this database is copied with the agent enabled, 10,000 e-mails will go out, regardless of the dates that the actual e-mails were received.
Subject: After New Mail Arrives Agents and clusters
We like the trigger, but don’t like the fact that the agent doesn’t always choose the right doc(s) to work on. To get around that problem we add a field like doc.processed=“1” the first time the agent processes a particular doc. On subsequent runs the agent looks thru all the candidates that the agent manager says are unprocessed, but only operates on the ones without this flag.
Subject: RE: After New Mail Arrives Agents and clusters
Yes I like the “After mail arrives” trigger, but I fail to see why refreshing the agent cache needs to cause it to run. They have a technote that says this is intended behavior but it is pretty dumb if you ask me. I am experimenting with ways to trick the agent into not running when it is activated by the cache refresh. My first idea is to add code to have it check what server it is running on and then skip running on the incorrect server (which is what the “After mail” agent trigger normally does, only running on the home server of the agent signer). If that doesn’t work I may try adding a flag as you suggest, but I would prefer not to modify and save documents unnecessarily…
Subject: RE: After New Mail Arrives Agents and clusters
One benefit of adding an explicit flag is then you can modify the agent as needed without having the worry that it will execute again on all the old docs.