[RFE] reusable agent unix socket connections for charms: python bindings

Bug #1770703 reported by Dmitrii Shcherbakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

Some charms can get quite heavy in terms of agent socket usage.

E.g. this https://paste.ubuntu.com/p/JFk7GzSjrh/ invocation of a single (!) keystone hook resulted in 202 connect(2) system calls to the same socket:

[pid 13985] connect(5, {sa_family=AF_LOCAL, sun_path=@"/var/lib/juju/agents/unit-keystone-6/agent.socket"}, 52) = 0

Since all of that communication happens via hook tool binaries we can easily add 202 fork(2)s and execve(2)s.

It seems that the ecosystem is at a stage where most of the charms are written in python 2 or 3 (or utilize https://pypi.org/project/six/) with new charms utilizing only python 3 (classic or reactive).

It would be good to avoid all of that overhead and have a python library that could be used in charm-helpers that would provide an API that would only utilize a single unix socket connection to the juju agent during the runtime of a given charm hook execution.

Tim Penhey (thumper)
Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1770703] Re: [RFE] reusable agent unix socket connections for charms: python bindings

I don't think it would be particularly hard. The existing API on the socket
is essentially just passing the []string of CLI args. It should mostly be
just a change to charmhelpers to maintain a socket connection and send the
requests.
That said, it may not be possible to pipeline the requests today. It might
require reconnecting to issue a new request. But it would avoid to fork
overhead

John
=:->

On Mon, May 14, 2018, 01:35 Tim Penhey <email address hidden> wrote:

> ** Changed in: juju
> Status: New => Triaged
>
> ** Changed in: juju
> Importance: Undecided => Wishlist
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1770703
>
> Title:
> [RFE] reusable agent unix socket connections for charms: python
> bindings
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1770703/+subscriptions
>

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.