Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Channel/Sources/EDOSocketChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ - (instancetype)initWithHandlerQueue:(dispatch_queue_t)handlerQueue {
if (self) {
// For internal IO and event handlers, it is equivalent to creating it as a serial queue as they
// are not reentrant and only one block will be scheduled by dispatch io and dispatch source.
_handlerQueue =
handlerQueue
?: dispatch_queue_create("com.google.edo.socketChannel.handler", DISPATCH_QUEUE_SERIAL);
if (handlerQueue) {
_handlerQueue = handlerQueue;
} else {
// Use QOS_CLASS_USER_INITIATED as the default because eDO communication is often in the
// critical path of user-driven test execution, and using a lower QoS can lead to priority
// inversion issues.
dispatch_queue_attr_t attributes = dispatch_queue_attr_make_with_qos_class(
DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0);
_handlerQueue = dispatch_queue_create("com.google.edo.socketChannel.handler", attributes);
}
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion Service/Tests/FunctionalTests/EDOServiceUIBlockTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ - (void)testBlockResolveToLocalAddress {

// Sending block to remote process through background eDO host.
dispatch_sync(backgroundQueue, ^{
pthread_set_qos_class_self_np(QOS_CLASS_DEFAULT, 0);
pthread_set_qos_class_self_np(QOS_CLASS_USER_INITIATED, 0);
remoteDummy.block = localBlock;
});

Expand Down
2 changes: 1 addition & 1 deletion Service/Tests/FunctionalTests/EDOServiceUITest.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ - (void)testTemporaryServiceHandlesRecursiveCall {
EDOTestDummy *remoteDummy = [EDOClientService rootObjectWithPort:EDOTEST_APP_SERVICE_PORT];
// Align QoS with eDO internal threads to avoid priority inversion.
dispatch_queue_attr_t attr =
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_DEFAULT, 0);
dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, QOS_CLASS_USER_INITIATED, 0);
dispatch_queue_t testQueue = dispatch_queue_create("com.google.edotest", attr);

XCTestExpectation *expectation = [self expectationWithDescription:@"recursive call completes."];
Expand Down