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

multithreading problems via __pmLogCtl sharing #386

Open
fche opened this issue Dec 7, 2017 · 3 comments
Open

multithreading problems via __pmLogCtl sharing #386

fche opened this issue Dec 7, 2017 · 3 comments
Assignees

Comments

@fche
Copy link
Contributor

fche commented Dec 7, 2017

There exist known / suspected problems in the way libpcp manages archive __pmLogCtl data structures for multithreaded applications. Opening this issue# for formal tracking.

https://groups.io/g/pcp/topic/6095761#16883

@goodwinos
Copy link
Contributor

@fche, as you know there is an __pmLogCtl rework in progress, mostly for multithreaded archive access. Is there an existing pmwebapi QA test that exercises this, or should we create a new one? I couldn't find one for tests in group pmwebapi.

@fche
Copy link
Contributor Author

fche commented Dec 14, 2017

pmwebd is multithreaded for answering wildcarded graphite timeseries queries, but structured in such a way that the particular __pmLogCtl mis-sharing behaviour isn't triggered by it. In order to make pmwebd more multithreaded (be able to serve multiple queries concurrently), it is much more likely to hit the problems. This will need some pmwebd side work to exploit.

Depending on how the auto-decompression bits are implemented exactly, the same timeseries stuff may already be useful in stress-testing it. I'd start by generating a large archive-directory of .0.xz files, then asking pmwebd for some narrow and some broad wildcard queries. There should be no crashes, and it should avoid catastrophic rlimit/OOM.

@goodwinos goodwinos self-assigned this Dec 14, 2017
@kmcdonell
Copy link
Member

Outside of the pmwebapi ecosystem qa/595 does a pretty good job of hammering this for a variety of concurrent access types to a variety of archives. Itr uses qa/src/multithread12.c:
Thread A: loops over pmNewContext, pmTraversePMNS { pmLookupName, pmLookupDesc } , pmDestroyContext
Thread B: loops over pmNewContext, pmDupContext, pmFetch forwards, pmDestroyContext (x2)
Thread C: loops over pmNewContext, pmFetch backwards, pmDestroyContext
Thread D: loops over pmNewContext, pmTraversePMNS { pmLookupName, pmLookupDesc, pmGetInDomArchive }, pmDestroyContext

At each test case, these are all running against the same archive or multi-archive.

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

3 participants