[Spread-users] bunch of log message spread 4.2

gary garycao at sina.com
Tue Mar 12 08:49:10 EDT 2013


hi, Jonathan

Thanks for your response.
I recompiled the code following your guide and did some stress testing. 
It works well so far.

regards
Gary

于 2013/3/12 19:06, Jonathan Stanton 写道:
> Hello Gary,
>
> On Mar 12, 2013, at 5:44 AM, gary wrote:
>
>> I moved my code from spread 4.1 to 4.2 recently. it runs just fine in
>> spread 4.1 ,but have bunch of log message in 4.2:
> Have you seen any other problems with 4.2 besides the log messages? If so, please let us know.
>
>> --------------------------------------------------------
>> E_attach_fd: fd 9 with type 1 exists & replaced & activated
>> E_attach_fd: fd 11 with type 1 exists & replaced & activated
>> ......
>> E_attach_fd: fd 9 with type 1 exists & replaced & activated
>> E_attach_fd: fd 11 with type 1 exists & replaced & activated
>> --------------------------------------------------------
>> check the spread source code found that it comes from E_attach_fd in
>> events.c:580.
>> for( j=0; j < Fd_queue[priority].num_fds; j++ )
>> {
>> if( ( Fd_queue[priority].events[j].fd == fd ) && (
>> Fd_queue[priority].events[j].fd_type == fd_type ) )
>> {
>> Fd_queue[priority].events[j].func = func;
>> Fd_queue[priority].events[j].code = code;
>> Fd_queue[priority].events[j].data = data;
>> if ( !(Fd_queue[priority].events[j].active) )
>> Fd_queue[priority].num_active_fds++;
>> Fd_queue[priority].events[j].active = TRUE;
>> Alarm( PRINT,
>> "E_attach_fd: fd %d with type %d exists & replaced & activated\n", fd,
>> fd_type );
>> return( 1 );
>> }
>> }
> I would suggest changing the "Alarm( PRINT" above to "Alarm( EVENTS" as then this message will only be logged when you explicitly enable the EVENTS log records (such as when debugging a problem) and not in normal operation. I don't see a reason this should be printed all the time, so I'll make this change for the next version. Note, as this change is in the libspread-util library code in 4.2, make sure to recompile that and the main spread code in daemon/ after you make the change.
>
>> calling from:
>> --------------------------------------------------------
>> 4.2 code(daemon/session.c:1756):
>> if( Sessions[ses].num_mess > 0 ) {
>> E_queue( Sess_badger_TO, mbox, NULL, Badger_timeout );
>> E_attach_fd( mbox, WRITE_FD, Sess_badger_FD, 0, NULL, LOW_PRIORITY );
>>
>> }else{
>> NO_WORK:
>> E_dequeue( Sess_badger_TO, mbox, NULL );
>> E_detach_fd( mbox, WRITE_FD );
>> }
>> --------------------------------------------------------
>> 4.1 code(daemon/session.c:1754):
>> if( Sessions[ses].num_mess > 0 ) E_queue( Sess_badger, mbox, NULL,
>> Badger_timeout );
>> --------------------------------------------------------
>>
>> Can I just delete spread 4.2's E_attach_fd and E_detach_fd code?
>>
> No, those changes are to fix a bug and improve the responsiveness of the message delivery path when the reader is slow.
>
> However, the above change to the events Alarm should remove the log messages if you do not enable the 'EVENTS' log flag in spread.conf.
>
> Cheers,
>
> Jonathan
>
>> regards
>> gary
>>
>>
>>
> -------------------------------------------------------------------------------
> Jonathan Stanton	 jonathan at spreadconcepts.com
> Spread Group Messaging	www.spread.org
> Spread Concepts LLC 	www.spreadconcepts.com
> -------------------------------------------------------------------------------
>
>
>> _______________________________________________
>> Spread-users mailing list
>> Spread-users at lists.spread.org
>> http://lists.spread.org/mailman/listinfo/spread-users
>
>
>




More information about the Spread-users mailing list