-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer is using 'write', but we need to use 'sendmsg' (wrapped by comms_unix_send) for ancillary data #111
Comments
@prajnoha At first glance I was finding this a bit confusing. I get it now I think. When I was looking at: Line 4175 in cf867f8
It had me looking around to figure out what was being sent. Do you think adding _chan_buf_send_socket() would be an improvement? (I'm not sure) Would you please elaborate on the comment at: sid/src/resource/worker-control.c Line 910 in cf867f8
|
Thing here is that "main process" <--> "worker" channels have buffers to send/receive data as a whole (and we're using our Now, unix domain sockets are a bit specific in way that besides the usual data (which can be normally handled by those What we do now in this case where we need to send data+ancillary data is that we read/write the buffer for data as usual. For the ancillary data (the file descriptors passed through unix domain socket), we need to do call the extra To avoid reading the data and ancillary data part separately, we'd need to enhance the buffer interface so it could accept the ancillary data too (...right now, we make use of FD passing capability only). Practically, this means the functions like The change would need to happen inside However, such change (adding support for ancillary data in buffer code) is questionable, because right now it's just that FD passing through unix domain sockets where we need this 'extra data passing` functionality. So it's questionable whether it would be worth the change:
|
...yeah. Currently, if you look at how we handle the data reception, we actually do (example with comms between main process and worker):
The advantage here is that the event loop can still process another parts in between this "data reception callback" call, calling another callbacks for different other registered events. Now, we don't do this for sending out the data - we have our own inner loops that try to send the data and they're looping up until the data is completely send (...or erroring out if there's an error) - the actual loop is inside the sid/src/resource/worker-control.c Lines 932 to 935 in cf867f8
Lines 184 to 197 in cf867f8
This means that if this "inner" loop would take longer for whatever reason, we'd be stalling all the other events registered with the "official" event loop. Besides that, this is also about having a clean solution where if we go through the event loop during data reception, we should do the same for data sending too so the solution for handling data transmission is symmetrical and not creating "exceptions" where one direction is handled one way and the other one is handled using a different way. This can be a source of wrong assumptions and related bugs in the future... |
Address FIXME in code:
sid/src/resource/worker-control.c
Line 942 in cf867f8
The text was updated successfully, but these errors were encountered: