Skip to content
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

Startup of platform manager and system layer has some issues around the wake event (WakeEvent) on Darwin #21857

Closed
bzbarsky-apple opened this issue Aug 12, 2022 · 0 comments · Fixed by #21859
Labels

Comments

@bzbarsky-apple
Copy link
Contributor

Problem

Run chip-tool. One of the first log lines is:

[1660308661009] [56112:126013718] CHIP: [DL] RequestCallbackOnPendingRead with no dispatch queue: callback may not work (might be ok in tests)

What's happening here is that the Darwin PlatformManagerImpl::_InitChipStack does these, in order:

  1. Create work queue.
  2. Call GenericPlatformManagerImpl::_InitChipStack
  3. Call DeviceLayer::SystemLayer().SetDispatchQueue()

During the execution of GenericPlatformManagerImpl::_InitChipStack,SystemLayer().Init() is called, which lands in LayerImplSelect::Init, which tries to set up the WakeEvent bits, which lands in LayerImplSelect::RequestCallbackOnPendingRead, and we log the above because we have no dispatch queue at this point: step 3 above has not happened yet.

The practical effect is that I expect when dispatch queues are being used WakeEvent does not work on Darwin, but I assume that it's also not used on Darwin in that case; instead dispatch to queues is used.

Proposed Solution

A few options:

  1. We could move SetDispatchQueue to before the GenericPlatformManagerImpl::_InitChipStack call. I think that should be safe, but @vivien-apple and @kpschoedel should check.
  2. We could make the log there be a progress log, not an error log.
  3. We could suppress the log during init.
  4. We could do nothing....
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Aug 12, 2022
woody-apple pushed a commit that referenced this issue Aug 16, 2022
System layer init wants to use the queue.

Fixes #21857
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this issue Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant