Re: Documenting APIs and bug #15

Hi all.

That's an amazing job Amelia!

I'm currently picking up server job where SMW is failing us.

The side effect of this work requires SMW to regenerate meta data in the
database which creates data maintenance jobs and our known loop issue
[0]. We are currently at 53 000 tasks. More details on why and how to
solve are given here [0].

Fortunately for us, the cron job picking up tasks only creates maximum
two job-runners. Something that wasn't the case when I started in
september. Such big job queue would have all our app servers to create a
new job runner at 30 minutes, per app[0-9] server (we generally have 4).
If I was to leave this like that, in six hours we would get to 100 000
jobs, no database answering for normal read visitors, and the job queue
would still continue climbing up as long as it can hammer the database
server. 

Hopefully the current wiki upgrade will stop this job-loop issue .

All should be rebuilt by the time you read this.

Have a good morning!

  [0]:
http://docs.webplatform.org/wiki/WPD:Infrastructure/procedures/Rebuilding_Semantic_Media_Wiki_when_job_queue_is_going_out_of_control

Renoir
~


On 2014-05-07, 7:21 PM, Amelia Bellamy-Royds wrote:
> Hi all,
>
> We've got a fix live, although we've got an extra clean-up task now on our
> collective to-do lists.
>
> Some quick background: The syntax is generated using a semantic mediawiki
> query of all the parameter properties set on a given page.  These
> properties are set by the template used to print out the list of parameter
> descriptions, and each one creates a "subobject" with its own properties
> (name, required, description).
>
> When it prints the property list to the page, that's just a simple series
> of template calls, so they are printed in the order the data was declared
> in the form.  However, when it uses the query to get the list of names,
> they are returned in an arbitrary order based on database hashcode id
> values.  You can sort the query, but only based on a specific property of
> the subobject, not by the original order in which the properties were
> declared.  So we need to create a property of each subobject that defines
> the index of that argument in the method call.
>
> I was unable to figure out any way to get Semantic MediaWiki to insert an
> auto-incremented counter for each instance of the parameter subobject.
>  Instead, I've added a field to the form where you can explicitly specify
> the index.
>
> So, in order to get the syntax to print out with all the parameters in the
> correct order, we'll need to go through and edit each page to manually type
> in "0", "1", "2" in the forms.  Good thing we were already planning to do a
> massive stock-check of all pages in the wiki, right?
>
> In the meantime, for all pages where index values have *not* been set for
> the API parameters, the syntax will print like this:
>
>     var result = object.arcTo(*see parameter list*);
>
> (if there are no parameters, it will just print with empty brackets as
> expected).
>
> Once parameter index values are set, it looks like this:
>
> var result = object.arcTo(x1, y1, x2, y2, radius);
>
>
> However, if you're editing pages, be aware that "Show Preview" will NOT
> display the syntax properly until after your changes have been saved.
>  That's because the query results in the preview will be based on the
> *current* state of the wiki, not based on the unsaved changes you've made.
>
> Also be aware that if you set index values for some but not all of the
> parameters, only those ones will show up int the syntax block.  All or
> nothing, please.
>
> Thanks to everyone else who was tossing ideas around here and on IRC.
>  Thanks especially to Dominique for hitting us over the head with the
> problem.
>
> NOW:  Who wants to go through the Bug Tracker and figure out which issues
> this closes and what is still left to do?
>
> ...Amelia
>
> P.S.  For reference, the new/changed pages are
>
> * http://docs.webplatform.org/wiki/Property:Parameter_index
> * http://docs.webplatform.org/wiki/Template:Method_Parameter
> * http://docs.webplatform.org/wiki/Form:API_Object_Method
> * http://docs.webplatform.org/wiki/Template:API_Object_Method

Received on Thursday, 8 May 2014 06:27:34 UTC