Mir

Merge lp:~afrantzis/mir/client-api-platform-operation-fds into lp:mir

Proposed by Alexandros Frantzis
Status: Rejected
Rejected by: Alexandros Frantzis
Proposed branch: lp:~afrantzis/mir/client-api-platform-operation-fds
Merge into: lp:mir
Prerequisite: lp:~afrantzis/mir/client-api-platform-operation-spike
Diff against target: 0 lines
To merge this branch: bzr merge lp:~afrantzis/mir/client-api-platform-operation-fds
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Fixing
Alan Griffiths Approve
Cemil Azizoglu (community) Approve
Kevin DuBois (community) Approve
Review via email: mp+243797@code.launchpad.net

Commit message

client: Add fd support to MirPlatformMessage

Description of the change

client: Add fd support to MirPlatformMessage

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

LGTM,

comment on a pre-existing issue, but
185 + repeated sint32 fd = 3;

Forces us to strip the ownership info of the FD's at a point before the ipc-processing code is dispatched with the message. I guess this is the price to pay for having SessionMediator inherit from the protobuf-generated stub, but it would be nice to have mir:Fd make it to the ipc-code and not have to deal with resource caches.

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

LGTM.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

36 + * The fd array is copied into the message, but the message does not take
37 + * ownership of the fds themselves.

When is it safe for the client code to close the FDs?

Also, we know what "take ownership" means, but is it clear in the C world?

review: Needs Fixing
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Updated docs.

> When is it safe for the client code to close the FDs?

From the new docs:

"the caller is responsible for keeping the fds open for as long as this message needs to remain valid"

How long is long enough depends on the context. For example, for mir_connection_platform_operation() call:

"The MirPlatformMessage used for the request needs to remain valid until this operation finishes"

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

(I don't have a factual basis on which to decide whether leaving the client with "ownership" of the FDs is the correct choice.)

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Landed and then reverted. Parent branch needs fixing.

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Needs Fixing
2125. By Alexandros Frantzis

Sync with parent branch

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

A merge of this branch in trunk followed by a revert has confused bzr. Rejecting this branch and resubmitting this code as part of:

https://code.launchpad.net/~afrantzis/mir/client-api-platform-operation/+merge/244272

Unmerged revisions

2125. By Alexandros Frantzis

Sync with parent branch

Preview Diff

Empty

Subscribers

People subscribed via source and target branches