Commit Graph

872 Commits

Author SHA1 Message Date
Brion Vibber
963260d262 Fix since_id and max_id API parameters for inbox-based loads; was failing if the exact id mentioned wasn't present in the inbox (or had been trimmed out) 2010-01-15 10:03:02 -08:00
Evan Prodromou
16742d0fde do since_id and max_id in inbox 2010-01-13 22:32:17 -08:00
Evan Prodromou
abd67452da go straight to the DB for inbox before insert 2010-01-13 22:12:19 -08:00
Evan Prodromou
4d7cdbf1c6 don't write Inbox if on a read-only page, but encache 2010-01-13 16:28:42 -08:00
Evan Prodromou
d032fc038a make sure whoGets() doesn't write anything 2010-01-13 12:37:01 -08:00
Brion Vibber
0e1f2d4b47 Fix regressions in XMPP output during inbox refactoring
- NOTICE_INBOX_SOURCE_* constants moved to common.php since Notice_inbox.php not always loaded
- fixed typo in User::staticGet() call which caused user #1 to receive messages once for each subscriber instead of for him/herself
- 'continue' -> 'continue 2' inside switch() statement to fix loop escape (PHP considers switch() a looping construct for break & continue)
2010-01-13 18:17:36 +00:00
Evan Prodromou
430bd69312 add events for subscribing to people and joining groups 2010-01-13 02:16:13 -08:00
Evan Prodromou
43ff542189 Don't save reply info for repeats 2010-01-13 01:13:06 -08:00
Evan Prodromou
8bfa7fdeaf repeats don't get posted to groups 2010-01-13 00:47:12 -08:00
Evan Prodromou
5397249e50 remove vestiges of Notice_inbox from cache clearing code in Notice 2010-01-13 00:45:12 -08:00
Evan Prodromou
1bbd19169f unimplement repeatedToMe() until we figure out how 2010-01-13 00:44:29 -08:00
Evan Prodromou
3d579fc580 memoize Notice::whoGets() 2010-01-13 00:16:54 -08:00
Evan Prodromou
436b8c845e Merge branch '0.9.x' into inblob 2010-01-12 23:53:52 -08:00
Evan Prodromou
fb0d837ddc remove transaction for Notice save; causes deadlocks 2010-01-12 23:41:33 -08:00
Brion Vibber
ec145b73fc Major refactoring of queue handlers to support running multiple sites in one daemon.
Key changes:
* Initialization code moved from common.php to StatusNet class;
  can now switch configurations during runtime.
* As a consequence, configuration files must now be idempotent...
  Be careful with constant, function or class definitions.
* Control structure for daemons/QueueManager/QueueHandler has been refactored;
  the run loop is now managed by IoMaster run via scripts/queuedaemon.php
  IoManager subclasses are woken to handle socket input or polling, and may
  cover multiple sites.
* Plugins can implement notice queue handlers more easily by registering a
  QueueHandler class; no more need to add a daemon.

The new QueueDaemon runs from scripts/queuedaemon.php:

* This replaces most of the old *handler.php scripts; they've been refactored
  to the bare handler classes.
* Spawns multiple child processes to spread load; defaults to CPU count on
  Linux and Mac OS X systems, or override with --threads=N
* When multithreaded, child processes are automatically respawned on failure.
* Threads gracefully shut down and restart when passing a soft memory limit
  (defaults to 90% of memory_limit), limiting damage from memory leaks.
* Support for UDP-based monitoring: http://www.gitorious.org/snqmon

Rough control flow diagram:
QueueDaemon -> IoMaster -> IoManager
                           QueueManager [listen or poll] -> QueueHandler
                           XmppManager [ping & keepalive]
                           XmppConfirmManager [poll updates]

Todo:

* Respawning features not currently available running single-threaded.
* When running single-site, configuration changes aren't picked up.
* New sites or config changes affecting queue subscriptions are not yet
  handled without a daemon restart.
* SNMP monitoring output to integrate with general tools (nagios, ganglia)
* Convert XMPP confirmation message sends to use stomp queue instead of polling
* Convert xmppdaemon.php to IoManager?
* Convert Twitter status, friends import polling daemons to IoManager
* Clean up some error reporting and failure modes
* May need to adjust queue priorities for best perf in backlog/flood cases

Detailed code history available in my daemon-work branch:
http://www.gitorious.org/~brion/statusnet/brion-fixes/commits/daemon-work
2010-01-12 20:45:09 -08:00
Brion Vibber
4cc9b183d7 Avoid spewing warnings about returning by reference on memcached cache misses by setting a var and returning it instead of trying to return false directly.
This hacky workaround is brought to you by DB_DataObject's PHP 4 roots.
2010-01-12 12:20:45 -08:00
Evan Prodromou
ecb3abf84c Merge branch '0.9.x' into inblob 2010-01-11 16:28:27 -08:00
Brion Vibber
f397d35527 Regression fix: don't spew notices to log every time we get a non-cached user object 2010-01-11 13:24:52 -08:00
Evan Prodromou
8809e577b2 Merge branch 'sessionidparam' into 0.9.x
Conflicts:
	lib/command.php
2010-01-11 00:45:26 -08:00
Evan Prodromou
866dfa6822 Merge branch 'master' into 0.9.x
Conflicts:
	classes/Memcached_DataObject.php
2010-01-10 14:18:19 -08:00
Evan Prodromou
2e42d3336a check before saving a thumbnail 2010-01-10 13:25:16 -08:00
Evan Prodromou
f463329b9a check before inserting File_oembed and File_thumbnail 2010-01-10 13:18:53 -08:00
Evan Prodromou
9d3893255a don't put Users with object IDs in the cache, and don't fetch them 2010-01-10 12:31:43 -08:00
Evan Prodromou
e2dee5fedb always set site/server to hostname if it exists 2010-01-10 00:20:08 -08:00
Evan Prodromou
3d723ed1ed allow hostname with SSL 2010-01-09 22:49:26 -08:00
Evan Prodromou
e8d85a1ef5 use nickname, not sitename, in domain for SSL 2010-01-09 22:48:05 -08:00
Evan Prodromou
deb5ee6154 correct superglobal variable name 2010-01-09 16:31:25 -08:00
Evan Prodromou
5ca41b6870 redirect to sitename.wildcard for SSL 2010-01-09 16:19:45 -08:00
Evan Prodromou
ed5828f30e Redirect to a one-time-password when ssl and regular server are different 2010-01-09 15:26:06 -08:00
Evan Prodromou
96e51dad4b whoGets() method for Notice 2010-01-09 13:55:54 -08:00
Evan Prodromou
5e81149e47 create new Inbox from Notice_inbox if not exists at read/write time 2010-01-09 10:26:50 -08:00
Evan Prodromou
920c878221 initialize an Inbox from Notice_inbox records 2010-01-09 10:02:07 -08:00
Evan Prodromou
1de0f37f0d disable all Notice_inbox functions 2010-01-09 10:02:07 -08:00
Evan Prodromou
72934e9f50 Revert "Replace Notice_inbox with Inbox"
We use Notice_inbox to transition to Inbox.

This reverts commit 7640d3f07b.
2010-01-09 10:02:07 -08:00
Evan Prodromou
1e7ec69190 some formatting changes to make inblobs work 2010-01-09 10:02:07 -08:00
Evan Prodromou
f2a403589c Use inbox instead of notice_inbox 2010-01-09 10:02:07 -08:00
Evan Prodromou
7ec27b657e Replace Notice_inbox with Inbox 2010-01-09 10:02:07 -08:00
Evan Prodromou
475bf6010f flip exe bit 2010-01-09 10:01:21 -08:00
Evan Prodromou
8b2f6c01fb add inbox data class 2010-01-09 10:01:21 -08:00
Evan Prodromou
c0a062dd85 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-07 14:56:09 -08:00
Ciaran Gultnieks
deeaafe712 Fixes to bugs where non-local messages were being wrong put in the public timeline and public xmpp feed 2010-01-07 20:59:31 +00:00
Evan Prodromou
b2bab7d7ca fixup keytypes so it returns the types no matter what kind of class it is 2010-01-06 23:34:59 -08:00
Evan Prodromou
a55939f3b1 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-06 23:23:30 -08:00
Evan Prodromou
e50410683f only encache new objects when insert was successful 2010-01-06 16:34:18 -10:00
Brion Vibber
4e2acd153b ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Brion Vibber
85554d0840 Rearrange Memcached_DataObject::staticGet() to avoid "only variables can be passed by reference" warnings when DB lookup fails and we return false.
(We need to keep it returning a reference because the extlib parent class is stuck in PHP 4-land and uses references everywhere, including this function's return value. Yuck!)

Also changed pkeyGet to drop the reference, since it doesn't have an upstream equivalent.
2010-01-06 13:35:13 -08:00
Brion Vibber
b93244395f Fix for broken profile flag admin UI: delete stray flag entries when users are deleted so broken entries don't litter the lookups.
* added ProfileDeleteRelated event to match UserDeleteRelated, to allow plugins to add extra related tables on profile deletion
* UserFlagPlugin: deleting flags when target profile is deleted
* UserFlagPlugin: deleting flags when flagging user is deleted
* UserFlagPlugin: fix for autoloader -- class names are case-insensitive. We may get lowercase class names coming in at times, such as when creating DB objects programatically from a table name.

Note that any already-existing bogus entries need to be removed from the database:
select * from user_flag_profile where (select id from profile where id=profile_id) is null;
select * from user_flag_profile where (select id from user where id=user_id) is null;
2010-01-06 11:10:33 -08:00
Evan Prodromou
35d4587172 encache on insert instead of decaching 2010-01-05 19:48:43 -10:00
Brion Vibber
8af7ba0226 Fix for overlong RT trimming: don't trim if textlimit is 0 (unlimited) 2010-01-05 16:16:25 -08:00
Brion Vibber
bbbec435b0 Fix for overlong RT trimming: don't trim if textlimit is 0 (unlimited) 2010-01-05 16:15:12 -08:00