-
Notifications
You must be signed in to change notification settings - Fork 91
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
Crash in sync-repl #5600
Comments
ASAN Report
|
FYI: another signature of this issue without asan: Thread 1 (Thread 0x7f2df63fe6c0 (LWP 1378)): And *info (aka ext (the extension data)) is 0x7 telling that factory extension data got corrupted so it is likely the same problem |
Ok, so the issue is related to dynamic plugins. Basically on the same connection where the plugin is enabled, we already set the factory extension for the operation before turning the plugin on. Then in that same connection the plugin later registers two new extensions and it tries to use them, but the extension allocation was already done and then we read past the original extension allocation. |
I think I've commented before that dynamic plugins are horrendously unsafe wrt to multi thread setups so we shouldn't allow them :( |
While I agree, the issue is here is how plugins get called (not a threading issue or race condition in this case), as none of code expects plugins to be enabled after the server starts up. In this case the "factory" code expects all "extension types" to be registered during the start up process. When it happens after the server starts then things break. Not an easy fix (but fixable), but then again dynamic plugins are not officially supported :-) |
Summary of issue [1] Enable dynamic plugins So the issue is that the factory extensions design simply does not work with any form of dynamic plugins. There are ugly hacks to get this working safely, but do we want to invest more time into dynamic plugins and all other features that could be impacted by it? Or just leave dynamic plugins unsupported? |
IMHO if we really want to support safely the dynamic plugin we should rather find a way to insure that no other operation is running when setting up the plugin (it should prevents all these multi thread race conditions that @Firstyear is speaking about.), But even that will not solve the factory extension issue (we will still have the problem |
@progier389 yeah we should fix the factory extension in this case. I guess Thierry told you about my hack idea, and glad to hear you don't think it's too hacky :-) Well perhaps next sprint we can work on that - there is no rush to fix it at the moment... |
…mic plugins is enabled Description: Our factory extension code was not designed to work with dynamic plugins. It assumes all extensions are regiestered at startup. If extensions are added after startup (when dynamic plgun is is enabled) then this breaks. The fix is to keep track in each "object" how many extensions were allocated, instead of relying on the global extension count. relates: 389ds#5600 Reviewed by: spichugi(Thanks!)
…mic plugins is enabled Description: Our factory extension code was not designed to work with dynamic plugins. It assumes all extensions are registered at startup. If extensions are added after startup (when dynamic plugins is enabled) then this breaks. The fix is to keep track of how many extensions were allocated per object, instead of relying on the global extension count. Patch written by Pierre Rogier - thanks! relates: 389ds#5600 Reviewed by: jachapman (Thanks!)
…mic plugins is enabled Description: Our factory extension code was not designed to work with dynamic plugins. It assumes all extensions are registered at startup. If extensions are added after startup (when dynamic plugins is enabled) then this breaks. The fix is to keep track of how many extensions were allocated per object, instead of relying on the global extension count. Patch written by Pierre Rogier - thanks! relates: #5600 Reviewed by: jachapman (Thanks!)
…mic plugins is enabled Description: Our factory extension code was not designed to work with dynamic plugins. It assumes all extensions are registered at startup. If extensions are added after startup (when dynamic plugins is enabled) then this breaks. The fix is to keep track of how many extensions were allocated per object, instead of relying on the global extension count. Patch written by Pierre Rogier - thanks! relates: #5600 Reviewed by: jachapman (Thanks!)
Issue Description
github CI found another random crash in sync repl plugin during the dynamic plugins test:
The text was updated successfully, but these errors were encountered: