User:MarkAHershberger/Weekly reports/2010-W20

Continuum
Ryan Lane got the instance up and running on Friday, so I didn't have much time to work on setting it up. I'll try to start the week off with that.

Long-running code and Strange behavior
While running the unit tests, I noticed that MySQL would lose the database connection before it got to DatabaseMySQL::strencode and, since that function doesn't error check the result of mysql_real_escape_string, bugs result. I fixed this by checking the result in that function and running mysql_ping if there is a problem, but I'm sure there are other places where this sort of bug will pop up. Since MediaWiki processes are not usually long-running, I'm not going to spend too much time tracking it down at the moment.

Vestigial Code
The call to mysql_ping was wrapped with function_exists even though mysql_ping exists in versions of PHP &gt;= 4.3 and we only support 5.1 and greater.

After stumbling upon this case of, I went through the MW core looking for other cases that check for PHP pre-5.1 and took them out.

User Messages
I managed to commit the basic framework for leaving user messages last week. However, a paper-bag error reinforced the importance of not committing unchecked code. In this case, I had tested the code, found some errors, fixed them, tested it, and then, for some reason, I decided to make one more “small” change and commit. This is the point where people in the know will say “DOH!”

In any case, I'll be looking at integrating CheckSyntax.php into my pre-commit. Despite writing up my pre-commit checklist I still haven't automated these checks so that they'll be performed consistently.

I haven't committed unit tests for this work yet, so I'll be working on that as well.

Job Queue
After talking about my error and the need for the User messaging framework (i.e. to provide feedback from asynchronous downloads) on IRC, a number of people said they thought that the Job Queue was just plain unstable. They mentioned a number of times the Queue had gotten stuck and no one noticed for several weeks.

I plan on discussing this problem with TimStarling and seeing what he thinks of the situation.