User Details
- User Since
- Feb 7 2017, 10:09 PM (390 w, 3 d)
- Availability
- Available
- LDAP User
- TK-999
- MediaWiki User
- Unknown
May 27 2024
May 23 2024
May 9 2024
I wonder if this method really is that hot—in the api.php-specific wall time flamegraph for May 8th, I get no hits at all for the method name, and ApiResult shows up as ~0.1%, which is so little that I have trouble finding it in the flamegraph. In the CPU time graph, ApiResult::applyTransformations shows up as responsible for ~0.4% of CPU time, but isMetadataKey is not visible there either.
May 7 2024
Looks like this already got reported as https://bugs.xdebug.org/view.php?id=2222. The author does not seem to be particularly swayed by it though...
May 6 2024
A couple of thoughts on next steps:
- We should decide whether we would like a vendor-agnostic tracing abstraction in core or if we're fine with using the OTEL interfaces. PSR-22 proposes a standard tracing interface for PHP, but the work appears to have stalled and the proposed interfaces seem rudimentary at best.
- We should also decide whether to use the official OTEL client at all or write our own. The former case would AIUI require a code review for security and other considerations.
- We should decide on the exact level of instrumentation we want. @Krinkle has rightfully warned that trying to instrument too much userland code would effectively be a resurgence of the old wfProfileIn/Out situation, with profiling calls creeping into ever more areas of the code. I generally agree with this, as IMO distributed tracing is not profiling—that job can be better than by and therefore should be left to a profiler. However, tracing instrumentation can bring two benefits:
To run the above PoC, you need a Jaeger deployment. This is trivially doable with the upstream all-in-one image:
$ docker run --rm -p 16686:16686 -p 4318:4318 jaegertracing/all-in-one:1.57
May 5 2024
Tentatively reopening as the service class has been a stub for a while.
May 4 2024
Minimal reproducer:
php <?php
We investigated further with @Krinkle today. Our results are follows:
- To reproduce, one needs to have XDebug loaded with xdebug.mode containing develop. Excimer does not appear to play any role.
- Xdebug 3.3.0 shipped a new feature of adding a from_exception option to xdebug_get_function_stack to return the stack trace where an exception was thrown. Internally, this functionality works by stashing local variables and other context alongside the trace for the last eight exceptions to have been thrown, implemented in https://github.com/xdebug/xdebug/pull/903.
May 3 2024
May 2 2024
Sorry, just got to the airport and so I hadn't seen your comment @Tgr before posting further. That probably makes more sense than what I was proposing :)
This is apparently a poorly documented quirk of PHP's $_COOKIE handling. WebRequest::getCookie is a thin wrapper around this superglobal. At a quick glance, there is plenty of code that accesses values through this helper and assumes that the return value is either a string or falsy. I think we could either:
- Fix all occurrences to check for and handle array values, or
- Handle array values in getCookie() and concatenate or otherwise normalize them.
Apr 25 2024
Boldly tagging Mediawiki-Platform-Team since the component is without an owner but the change should be very simple.
Apr 24 2024
This is a headache for sites that host sister projects under the same domain:
- https://starwars.fandom.com/wiki/essences:Test works as expected,
- https://starwars.fandom.com/wiki/es:Test only works thanks to a bag of tricks involving hijacking the BadTitleError thrown from the init code to serve a redirect anyways.
Apr 10 2024
Apr 6 2024
The error comes from \Wikimedia\PhpSessionSerializer::decode - it seems the serialization format may have changed.
Apr 5 2024
Patch updated.
Mar 14 2024
Mar 5 2024
@Yaron_Koren Yeah, this could also be integrated with the special page, good idea!
Something that came up recently (in the context of lol.fandom.com) was the ability to add rate limits to the Cargo query API, since there have been a few cases of people accidentally issuing too many queries in too short a timeframe. I made a patch for that.
Feb 13 2024
Feb 12 2024
Feb 6 2024
Feb 5 2024
It seems that kqueue is usable on macOS for at least wall-time profiling and simple timers—and unlike other Apple-specific APIs, should be available on other OSes too like BSD, which should facilitate testing. I cobbled together a patch leveraging this that seems to work on macOS.
Feb 3 2024
Jan 30 2024
This should no longer be necessary, as the mentioned tests have been adjusted to not need such functionality.
Jan 23 2024
Dec 20 2023
Having something in place for REST that would allow handlers to specify whether they depend on a session SGTM irregardless—but we should consider the case where a handler unknowingly ends up depending on the session because of some deep dependency.
Dec 19 2023
Nov 23 2023
Nov 13 2023
Nov 2 2023
Oct 25 2023
What page(s) does this happen on reliably?
Oct 17 2023
Thanks @Alex44019 and @cscott for raising this one. I remember discussing it with the team a while back, but the Parsoid extension API was considerably less fleshed out back then.
Oct 15 2023
Oct 13 2023
Might be worth to manually patch the affected plugin in CI—Phan seems to have been in development limbo for most of this year, there is very little activity both in terms of code changes and responding to issues.
Oct 11 2023
Oct 9 2023
Rebased this since it got a question about its status, just wanted to note per earlier discussions on the patch that T296023 probably needs to be resolved first to unblock this.
Perhaps one option could be to add a new method to WikiPageFactory that returns an optionally cached WikiPage instance for a given PageIdentity. That could then be used as a replacement without a performance cost.
Sep 27 2023
Thanks for the CC.
Sep 13 2023
Aug 15 2023
Possibly. I think it's worth disabling the JIT (ie making sure that opcache.jit_buffer_size is unset or 0, which is the default) though just to rule it out as a cause—it's been known to cause oddball issues when it is enabled that simply do not occur when it is off, and its maintenance status in general is dubious.
Might be worth an upstream report if a minimal reproducer can be isolated.
Jul 26 2023
@Clement_Goubert Yeah, we currently set a limit of 1 CPU per worker. We have not experimented with pinning.
We were consistently throttled until we set limits == FPM worker count. Per the description (and Dan Luu's insightful foray[1]) into the topic, I don't think there is much that can be done besides adjusting or removing the limits or tweaking the CFS period that k8s uses. Removing the limits is probably fine given that the size of the worker pool is a natural upper bound on concurrency with pm = static.
Jul 25 2023
We've encountered spurious memcached timeouts (likely due to packet loss) with MW on k8s since forever. Are there any memcached errors logged as part of the same request?
Jul 21 2023
Jul 18 2023
Thanks, this is great!
Jul 17 2023
I think this is not a PHP 8.0 specific issue, it'd likely happen on earlier versions as well. We just happened to notice it because we were on the lookout for core dumps while investigating unrelated JIT issues.
Thanks a lot, Tim :)- using your advice, I inspected a more recent dump and found that it was a request where PHP was exceeding its configured memory limit while it was parsing a rather complex page. Going by that, I managed to narrow it down to a consistent reproducer:
--TEST-- Memory limit exceeded during sandbox init --INI-- memory_limit=2M --FILE-- <?php $buf = str_repeat('a', 1000000); $sandboxes = []; for ($i = 0; $i < 100; $i++) { $sandboxes[] = new LuaSandbox(); } ?> --EXPECTF-- Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
Jul 16 2023
Jul 15 2023
Thank you, I forgot to circle back and close this task.
Jul 14 2023
Jul 12 2023
I wonder if OpenTelemetry metrics could be an alternative here.[1] T340551 makes it seem likely that the OTEL Collector will be deployed as an infrastructure component, so it could potentially be leveraged for exporting metrics in Prometheus format[2] while avoiding the use of APCu or a dedicated storage backend. What do you think?
Jun 13 2023
Thanks! Sorry, it seems I missed one spot so I made a fast follow.
Jun 8 2023
Jun 2 2023
It seems that the libmustache library used by php-mustache for actual mustache rendering purposes does not yet support referencing section data in some cases, i.e. given data like
$data = [ 'foo' => 'bar' ];
then
{{#foo}}{{.}} should be bar {{/foo}}
won't render correctly. Vector 2022 heavily uses this, so I made https://github.com/jbboehr/libmustache/pull/25 to hopefully try and fix this.
May 21 2023
Tagging Wikimedia-Hackathon-2023 to showcase a basic PoC created during this event.
May 20 2023
May 19 2023
Apr 25 2023
Apr 17 2023
Apr 14 2023
Mar 29 2023
That should be fine for now. After that, we could either:
- Configure PageForms to ignore Phan stubs in other extensions via a config stanza such as $cfg['exclude_file_regex'] = '@^../../extensions/Cargo/.phan/stubs/@';, or
- Reimplement the hooks change in Cargo without stubs. This will require people to have a checkout of the AdminLinks extension to run phan locally and will also need a corresponding integration/config patch as noted by Sam.