On Sun, 8 Aug 2010 17:57:54 +0200 Stevan Bajić <ste...@bajic.ch> wrote:
> On Sun, 08 Aug 2010 15:52:58 +0200 > Tom Hendrikx <t...@whyscream.net> wrote: > > [...] > > > > > > # cat /var/spool/dspam/group.away > > > groupname:classification:*classicifation_user > > > > > >> Could you post the output of "select * from dspam_virtual_uids where > > >> username = 'classification_user'"? > > > > > > vmail=# select * from dspam_virtual_uids; > > > uid | username > > > -----+------------------------ > > > 1 | classification_user > > > 2 | tomhe...@example.com > > > (2 rows) > > > > > > > And a few minutes after sending the mail, I thought that I might have > > made a typo. And I did: classification_user != classicifation_user > > > Good catch. > > > > Sorry for the noise. However, I still think that an error message > > explaining the issue would help a lot. > > > > Error: processing message for user tomhe...@example.com failed: unable > > to find user 'classicifation_user' for peer classification. > > > > looks so much better than: > > > > bailing on error -2 > > process_message returned error -5. delivering. > > > You are right. The error message could be better. However... it's not that > simple. > I got a bunch of messages asking me why this is not that simple and I am going to explain here instead of writing individual messages back. The way how DSPAM is currently implemented its nothing more then a bunch of functions that get called when messages are processed. Now each of those functions has a return value. Most of them do something and then return either success or failure. Some of them return more then just that success/failure but for simplicity reasons let's say they just return success/failure. Processing a message cascades a bunch of calls. Let me try to explain: function a -[calling]-> function b -[calling]-> function c -[calling]-> function d Now assume "function a" is the one that is doing the classification. And assume that "function b" is doing that group classification (innoculation or classification network, etc). And now assume "function c" is responsible for loading the tokens for another user (the group user) and assume "function b" is responsible for doing that loading of tokens from the configured storage backend. Now assume "function d" is failing because it can not find the user (like in Tom's example) then "function d" will return a failure. "function d" can then easy log an entry saying that it could not read data for user XYZ. What "function d" does not know is that it was called all the way up from "function a". So it can not print a log entry saying "Error: processing message for user tomhe...@example.com failed: unable to find user 'classicifation_user' for peer classification.". All it can do is say that it can not find the target user XYZ. "function c" has then the same issues as "function d". It only can say that the task "function c" is supposed to do has failed because of "function d" failing. "function b" on the other hand does not know that "function d" failed. All it knows is that "function c" failed. And therefore it can only print a log entry saying that the task "function b" is supposed to do has failed because "function c" has failed. And the same goes for "function a". They all only know the result from their last call into a sub function. I know, I know. This sounds complicated. Let me make it more complicated. Assume this: {function a} -[calling]-> {function b} -[calling]-> {function c} -[calling]-> {function d} | +[calling]-> {function e} -[calling]-> {function d} | +[calling]-> {function f} and so on and so on... You can imagine how hard it is for "function a" to know where it failed. And DSPAM's calling tree is way more complicated then just the above two simple cases. They are a gazillion of functions called everywhere and it's not easy with the current code to unify the error messages. This is the reason I wrote "it is not that simple". > I anyway need to change the whole code for better error handling in case of > non existing users. > > Could you try the attached patch? It will not print out the error message you > requested but should work better in cases when ensure_confident_result() is > returning a wrong result. > > Could you send me a new debug output with the applied patch? > > > > >> Do you have more lines from the log? I mean: Could you post more lines > > >> from the log from above? How can > > >> "_pgsql_drv_getpwnam(classicifation_user)" return NULL if the user > > >> exists/existed in dspam_virtual_uids? > > >> > > > > > > I created a new debug file, see attachment for complete output. > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > This SF.net email is sponsored by > > > > > > Make an app they can't live without > > > Enter the BlackBerry Developer Challenge > > > http://p.sf.net/sfu/RIM-dev2dev > > > > > > > > > > > > _______________________________________________ > > > Dspam-devel mailing list > > > Dspam-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/dspam-devel > > > > > > -- > > Regards, > > Tom > > ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Dspam-devel mailing list Dspam-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspam-devel