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

[NSConcreteTask waitUntilExit] Error #28

Closed
SENTINELITE opened this issue Apr 11, 2024 · 9 comments
Closed

[NSConcreteTask waitUntilExit] Error #28

SENTINELITE opened this issue Apr 11, 2024 · 9 comments

Comments

@SENTINELITE
Copy link
Contributor

Hey, Emory!

This bug's been haunting me for many, many months. I think it's related to the WebSocket stuff, can you confirm?

I'll add that this was on far older versions of the package, but I'm still seeing them up-to the more recent #21's GlobalSettings branch. I haven't isolated it to the most recent main branch, but I assume it's still there?

Some people say it occurs when the computer wakes up from a sleep cycle, network changes (VPNs/WIFI, etc).

It's extremely hard to reproduce. I've (personally_ only had it a handful of times, since I picked up this project.

I'm also unable to attach to the process via Xcode's debugger tools.

Lastly, is there anyway to get the StreamDeckPlugin's osLogs to filter through Elgato's logger? (logMessage), so end-user debugging is easier?

From a support ticket:

It could be related to changing WiFi networks. Every day I go between office and home. Maybe this is invalidating the client/server socket addresses due to routing/gateway changes and they need to be closed and restarted. Basically if you can get any socket logging enabled this will probably help.

SENTINELITE/StreamDeck-Shortcuts#19

@emorydunn
Copy link
Owner

I don't think I've seen anything like that with my plugins. I'll ask around with my users to see if they've noticed anything. I'm not directly calling NSConcreteTask (I don't think), so that would indicate a deeper issue in theWebSocket API, perhaps.

As for the logging, good question. I probably could manually log more events through the Elgato logger, although if the issue is with the WebSocket the plugin would be shouting into the void with logMessage. If nothing else I can look for any instances I'm calling log.debug, in which case the message isn't preserved, and replace it with log.log.

I've build a log collection mechanism for my GUI apps, so I can probably build a log collection plugin action into the library. Then the plugin developer could include that in the manifest for a nice single-button action to save the logs to Downloads. Probably only useful if you're sending betas outside of the Elgato store, but if folks are creating issues on GitHub they can probably manage.

@SENTINELITE
Copy link
Contributor Author

Hm. I'm not really sure what that means? Should I file a Radar with Apple or?

I'm seeing the following event's failing, when a crash is happening.

3   StreamDeck-Shortcuts_Alt      	       0x10469c648 PluginCommunication.parseEvent(event:context:data:) + 33184 (PluginCommunication.swift:419)
4   StreamDeck-Shortcuts_Alt      	       0x10469299c PluginCommunication.parseMessage(_:) + 936 (PluginCommunication.swift:168)
5   StreamDeck-Shortcuts_Alt      	       0x104691a6c closure #1 in PluginCommunication.monitorSocket() + 692 (PluginCommunication.swift:130)

As per the logs, that'd be a welcome addition!

@emorydunn
Copy link
Owner

I'd hold off on the Radars, the odds of that's it's an error on my end, compared to Apple, are fairly high.

Those logs are super interesting. Line 419 is where device connection events are handled, which certainly tracks with the issue. However, if an error is thrown there it should be handled further up the chain in a non-crashing way. I'll have to give your repo a clone and see if anything jumps out.

No promises on the timeline for any logging improvements, I should probably merge in all of the pending changes first 😅

@SENTINELITE
Copy link
Contributor Author

Got it. V1 has some large bugs, so I'd give this version a clone. It should be (mostly) smooth. SENTINELITE/StreamDeck-Shortcuts@55d0135

No promises on the timeline for any logging improvements, I should probably merge in all of the pending changes first 😅

Of course. That makes sense! It was just something that stood out to me, that would make the DX a little better!

@emorydunn
Copy link
Owner

I was looking through the library code, and realized there actually has been a change that may be related to the issue. I switched to using a run loop for keeping the plugin alive. Unfortunately I didn't document why I made the change, but it would be worth updating to see if the issue persists.

@SENTINELITE
Copy link
Contributor Author

Alright. I've bumped to the latest version & will keep you posted, after I get some feedback.

Thanks, Emory!

@SENTINELITE
Copy link
Contributor Author

It seems to be that these related changes have fixed those issues! Thanks a lot, Emory!

@emorydunn
Copy link
Owner

Great to hear that solved the problem. Does this count as fixing a bug in negative time? 😆

@SENTINELITE
Copy link
Contributor Author

Hahaha, absolutely! 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants