Commit Graph

900 Commits

Author SHA1 Message Date
Evan Prodromou
d25bd9b292 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2010-01-22 14:19:08 -05:00
Evan Prodromou
c8bc598cfd Merge branch 'testing' into 0.9.x 2010-01-22 14:18:43 -05:00
Evan Prodromou
e666433eb4 Merge branch 'master' into 0.9.x 2010-01-22 14:18:40 -05:00
Evan Prodromou
29d83c8ca9 Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing 2010-01-22 14:18:21 -05:00
Evan Prodromou
a3e484a0e8 Memcached_DataObject unnecessarily require_once'd itself 2010-01-22 10:46:11 -05:00
Craig Andrews
672126968f Updated some references to the long gnone "isEnclosure" function to the new "getEnclosure" 2010-01-22 10:12:26 -05:00
Brion Vibber
0e852def6a XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.
2010-01-21 22:40:35 -08:00
Brion Vibber
26fdf0c9d2 XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.
2010-01-21 16:42:50 -08:00
Brion Vibber
c9c7bb3234 Merge commit 'origin/testing' into 0.9.x 2010-01-21 16:33:11 -08:00
Brion Vibber
8dafe09ab2 Option to log slow db queries or all db queries
$config['db']['log_queries'] = true; // all
$config['db']['log_slow_queries'] = 10; // queries taking > 10 seconds
2010-01-21 11:07:52 -08:00
Evan Prodromou
01dc77c2fd Merge branch 'master' into 0.9.x 2010-01-19 00:31:42 -05:00
Brion Vibber
d35faa04c1 Fix for background recalculation of groups; needs to get Group objects not IDs; also don't list any groups for repeats to match saveGroups behavior
todo: merge calculation portion with saveGroups so they don't get out of sync
2010-01-15 13:06:21 -08:00
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
Brion Vibber
745d428365 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:01:50 -08:00
Brion Vibber
ef016dca45 Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x 2010-01-15 09:52:50 -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
Zach Copley
ee8c1ec91c Add verifier and verified callback to token for OAuth 1.0a 2010-01-14 02:41:10 +00:00
Zach Copley
ead1ef4c68 Remove verifier from Oauth_application_user (not needed there) 2010-01-14 02:41:10 +00:00
Zach Copley
38269a6579 Revoke access token UI 2010-01-14 02:41:10 +00:00
Zach Copley
0d7490470d Can now edit/change application icon 2010-01-14 02:41:08 +00:00
Zach Copley
31c5ebb95c Better detial in connected OAuth applications list 2010-01-14 02:41:06 +00:00
Zach Copley
bfe3e3c74e Decided we didn't need to keep the token secret in the
Oauth_application_user record
2010-01-14 02:41:06 +00:00
Zach Copley
d8abad7478 Exchanging authorized request tokens for access tokens working 2010-01-14 02:41:06 +00:00
Zach Copley
e7f4ab6774 Associate request tokens with OAuth apps and app users 2010-01-14 02:41:05 +00:00
Zach Copley
b14a97f5f9 Add icons/icon upload to Oauth apps 2010-01-14 02:41:05 +00:00
Zach Copley
dad67b030f Workflow for registering new OAuth apps pretty much done. 2010-01-14 02:41:04 +00:00
Zach Copley
8e0499a233 It might help if I checkd in statusnet.ini. 2010-01-14 02:41:04 +00:00
Zach Copley
5bff6651ba Started work on interface for displaying connected OAuth apps 2010-01-14 02:41:04 +00:00
Zach Copley
6e64ce3777 Changed the OAuth app tables to refer to profiles instead of users.
Added an owner column to oauth_application.
2010-01-14 02:41:04 +00:00
Zach Copley
14bcac31b8 Add new OAuth application tables and DataObjects. Also add a new
column for consumer secret to consumer table.
2010-01-14 02:41:04 +00: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