RPC connection issues with pylibjuju

Hi @simonrichardson,

I did remove a few results from db.actions using this syntax:
db.actions.updateOne({"_id": "<model_uuid>:<action_id>"}, ($set: {"results": {} }})
Doing a find("_id": "<model_uuid>:<action_id>"}) shows an empty results entry.
Now when running a script (pylibjuju) the deltas still contains the previous data, as emptying results is not committed.

You need to bounce the agent (service), as we hold the information in a local cache. I’ve updated the instructions above.

@simonrichardson, I may do something wrong,

  • a juju dump-model show empty results
  • the deltas still have

after systemctl restart jujud-machine-0.service (controller)

  • juju dump-model still smaller (passed from 9477406 to 349957, that was doing the db.actions.updateOne())
  • but deltas are still having the results full.
  • but I have less deltas (from 210 -> 198)

Ok, might be some kind of delay, fine by now

Hi all,

To let you know about the size of the model this morning.
Between the 18th around 11am, size=349717
This morning 21th around 05am, size=349964
So no much than 200 bytes fairly good.

Two thoughts.
The script is reduced to two “run” calls.

  • action = await unit_instance.run_action('backup') <= which obviously is the backup action, which should generate a first “delta”
  • action = await unit_instance.run(cmd.format()) <= and this, which will launch a cmd on the remote host, generating a second “delta”.

Thus, the minimum of deltas are created.
the second cmd is a string a of shell commands, to be performed after the dump from the backup run_action, where the backup folder is packed, move to storage, then things are cleaned up.
Each shell command is redirected to a local log file, minimizing the delta results entries.

Many thanks to all,
Know a bit more of juju internals.

Regards,
And Have a good day.

Honestly, we shouldn’t be including the content of the action results in the all watcher delta. We could include the fact that an action has been run/status changed/etc, but the output of the action should not be in a Watcher stream.