Closed BunningsWarehouseOfficial closed 10 months ago
yeh, we haven't added all the various socket options - we tend to add things like this as people request them - we can certainly take a look at adding a handful of these though
Could we go about requesting implementation of the socket opt names above? Would be handy to be able to use Nanos for a service running AMQP.
I don't know when we'll get to it but we can take a look
@BunningsWarehouseOfficial I added to the Nanos kernel support for the above socket options in https://github.com/nanovms/nanos/pull/1973. I tested the AMQP Python client with these changes, and it works fine, as both a producer and a consumer.
If you want, you can try it out by adding the --nanos-version 3348993
option to your Ops command line, e.g. ops pkg load eyberg/python:3.10.6 -c amqpConfig.json --nanos-version 3348993
.
Sweet, thank you! We've tested it with our setup and it works like a charm.
After creating a pip venv and running
pip install amqp
, I run the following command:ops pkg load eyberg/python:3.10.6 -c amqpConfig.json
amqpConfig.json:
amqp_test.py:
I get the following error:
The amqp package tries to get the following SOL_TCP socket options:
After doing some digging (with the help of #1121) through system_structs.h and netsyscall.c, and playing around with the errors I receive, it appears to me that the following socket {level, optname} pairs aren't implemented by Nanos (at least as far as
getsockopt
is concerned I guess)?Also, this may not be relevant, but if I change this line in amqp to be
tcp_opts[enum] = sock.getsockopt(1, getattr(socket, opt))
, where1
represents the value for SOL_SOCKET instead of SOL_TCP, and comment out'TCP_WINDOW_CLAMP',
on this line, then the above test code (and my full application which I was debugging) works perfectly, which I found to be strange given that it's such a hack.Forgive my ignorance, as I'm new to OPS/Nanos and know very little about sockets, but is this known/expected/intentional/expected?