[ANN] aDSA v1.5.2 Release

aDSA v1.5.2 — Ada’s Distributed Systems Annex over ZeroMQ: dynamic networks, IPv6, and a new home

aDSA is a Partition Communication Subsystem (PCS) for Ada’s Distributed
Systems Annex (Annex E), replacing the discontinued PolyORB/GLADE runtime.
The compiler side of the Annex lives on in FSF GNAT; aDSA supplies the
runtime the generated stubs call into (System.RPC,
System.Partition_Interface, System.Shared_Storage) plus pcs_gnatdist,
a gnatdist replacement that builds a distributed application from its
.cfg. Same-host deployments have a shared-memory sibling,
ipDSA.

New home

The project has moved to GitHub - charlie5/aDSA: ZeroMQ-backed Partition Communication Subsystem for Ada's Distributed Systems Annex (Annex E) — a runtime replacement for the deprecated PolyORB · GitHub (the old
Codeberg pages carry a moved notice). The Alire crate moved with it — the
published versions were re-verified byte-identical, and this release is the
first to use a plain git-tag origin.

What’s new in v1.5.2

Most of this release traces back to feedback from the project’s first
outside user — someone building test-equipment control over DHCP-discovered
instruments — so the theme is networks where addresses aren’t known in
advance
:

  • DSA_HOST=auto — a serving partition can derive the address it
    advertises from the machine’s route to the name server (a UDP-connect
    probe; no packet sent, works with the name server down). One unmodified
    launch script then works on any host. Opt-in; explicit DSA_HOST always
    wins; NAT/container topologies still want an explicit address.
  • IPv6DSA_IPV6=1 enables dual-stack sockets on every channel.
    Bracket literal v6 addresses in endpoints
    (DSA_NAME_SERVER=tcp://[fd00::7]:5700); set it on every process of a
    deployment.
  • The classic cross-host mistake now diagnoses itself. Forgetting
    DSA_HOST on a serving partition used to mean a silent hang on the first
    remote call. The name server now prints a WARNING at registration time,
    naming the fix.
  • DSA_HOST documentation rewritten — what the variable actually is
    (“the address at which I can be reached”), a per-process table of who
    needs it (the name server doesn’t), and troubleshooting entries keyed to
    the observable log signatures.
  • Examples reorganized — all 40 examples in category sub-folders
    (corpus, basics, racw-ras, shared-passive, robustness, concurrency,
    building, cross-host, gnat-bug), indexed by examples/README.md.

The new features are verified on Linux, FreeBSD and Windows, including true
two-machine deployments over both IPv4 and IPv6; the release gate (the
unmodified PolyORB examples/dsa corpus, both build paths) is green on
Linux x86_64, Windows 11, FreeBSD 15.1 and 32-bit ARM. The Alire index CI
additionally built this release on macOS (ARM and Intel).

Getting it

alr install adsa      # tools onto your PATH (v1.5.2, from the community index)
alr get adsa          # or: a local workspace to poke around in
git clone --branch v1.5.2 https://github.com/charlie5/aDSA   # or: plain git

Start with docs/users-guide.md; examples/ holds runnable demos of every
feature. Feedback very welcome — both waves of it so far have directly
shaped releases.

3 Likes

I tried using aDSA to replace polyorb in a simple school book example, it didn’t work so far.

Here’s the my_app.manifest:

pcs_supervisor manifest for configuration My_App
nameserver /home/drm/.alire/share/adsa/build/pcs_nameserver
boot tcp://127.0.0.1:5700
partition server_part - none 3 60 quarantine /home/drm/Documents/Math, Ada/books/Sourcecode Ada for software engineers/programs/c22-distributed/dist/server_part
partition client_part - none 3 60 quarantine /home/drm/Documents/Math, Ada/books/Sourcecode Ada for software engineers/programs/c22-distributed/dist/client_part

And the cfg file:

configuration My_App is
   Server_Part : Partition := (Simulation_Server);
   Client_Part : Partition := ();
   procedure Dist is in Client_Part;
end My_App;

the non-distributed version (no change but the ignoring annex E pragmas) works, but this just hangs when Dist makes a call to the remote Call Interface package:

[nameserver] listening on tcp://127.0.0.1:5700 (clients use tcp://127.0.0.1:5700)
[nameserver] REG pid=1 rep=- pull=- units=0
[nameserver] REG pid=2 rep=tcp://127.0.0.1:36987 pull=tcp://127.0.0.1:46803 units=0
[nameserver] CTL pid=2 ctl=tcp://127.0.0.1:39333
 Choose system e

If you’ve got an idea to troubleshoot this, I am listening.

Hi DRM, welcome to the forum …

Thanks for the report — and for pasting the name-server log, which turned out
to contain the whole answer. I reproduced your hang here against the
unmodified book sources (motib/ada-software-engineers,
programs/c22-distributed/dist) using your .cfg exactly as posted. Two
separate things went wrong, and a bug of mine hid both.

1. Your server partition was hosting nothing (my fault :/)

This line is the smoking gun:

[nameserver] REG pid=1 rep=- pull=- units=0

That is server_part registering zero units and binding no serve
endpoint — so it exits immediately, and Dist then waits for an RCI unit
that nobody hosts. (pid=2, with endpoints and units=0, is client_part
serving RACW callbacks — that part is correct and expected, because
Root_Event is a Remote_Types package.)

The cause is in your message: “the non-distributed version works.” Building
it that way first leaves simulation_server.ali / .o beside your sources.
The final gnatmake then has that directory on its search path, decides the
unit is out of date against the stale .ali, and recompiles it without
-gnatzr
— silently discarding the receiver stubs pcs_gnatdist generated
seconds earlier.

Fix: delete the build artefacts in
.../c22-distributed/dist and rebuild:

cd '.../programs/c22-distributed/dist'
rm -f *.ali *.o
pcs_gnatdist my_app.cfg

You should then see units=1 for server_part in the name-server log.

2. Dist is interactive, and the launcher backgrounds it

dist.adb does Put(" Choose system "); Get(C);. The generated
start-my_app.sh starts every partition with prog &, and POSIX gives a
background command /dev/null on standard input — so Get(C) hits
end-of-file before any remote call is made. The e in your output is
your terminal echoing your keystroke, not the program reading it.

Fix: run the interactive partition in the foreground, in its own
terminal:

export DSA_NAME_SERVER="tcp://127.0.0.1:5700"
pcs_nameserver &
./server_part &
./client_part          # foreground — it needs the keyboard

3. Why you got a hang instead of an error — my bug

Both of the above should have printed a clear message. They didn’t, because
a partition that serves callbacks (yours does) declared its serve tasks in
the same block that runs your main: an exception leaving that block waited
for
tasks that only the skipped shutdown would stop, so it could surface
only after they ended — i.e. never. Silent hang, no diagnostic, whatever the
underlying error.

That is fixed, along with the rest, in v1.5.3 (released today):

  • a failing partition main is reported and the partition exits non-zero;
  • a lookup for an unregistered RCI unit names the unit after 2 s instead of
    waiting 10 s in silence;
  • pcs_gnatdist warns about leftover .ali files up front and fails the
    build
    if a partition’s DSA stubs did not survive it — so problem 1 above
    can no longer happen quietly;
  • a partition with nothing to serve says so rather than exiting mutely.

No wire or API change: 1.5.2 and 1.5.3 deployments interoperate identically.
It is tagged on GitHub now and the Alire index PR is submitted, so alr update && alr install adsa will pick it up once that merges. You don’t need it to get going, though — the two fixes above
work on 1.5.2 as it stands.

It does work

For what it’s worth, once past those two problems, the example runs end to end under
aDSA, distributed dispatching and all:

 Choose system Engine fuel  500 L, oxygen  600 L

The server’s Root_Event.Simulate(E_Ptr.all) dispatches back through the
RACW to the client partition that created the object, which is exactly the
point of that chapter. Please do report anything else you hit — this one
found three real bugs.

Regards,
Rod.

1 Like