• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

\"General\" Chat Room Stop Accepting Messages

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
21 posts • Page 2 of 2 • 1, 2

Postby phpfreechat » Tue Jul 31, 2007 8:23 pm

Now you are in the sourceforge dev team.
I just sent you an email on sourceforge to explain you what I did.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby King Moonraiser » Tue Jul 31, 2007 9:04 pm

Thank you. I commited the changes to Subversion. I'm going to begin looking at the other file operations like the log file handling.
King Moonraiser
Member
 
Posts: 98
Joined: Fri Jun 22, 2007 9:42 pm
  • Website
Top

Postby King Moonraiser » Wed Aug 01, 2007 10:24 pm

The chat is much more stable now, but I have been able to reproduce this bug under VERY heavy load. I had about 14 users posting in multiple rooms.

I will continue to look at other areas where corruption can happen. However, I strongly suggest the following patch to the _requestMsgId() function.

Code: Select all
  /**
   * Return a unique id. Each time this function is called, the last id is incremented.
   * used internaly
   * @private
   */
  function _requestMsgId($chan)
  {
    if ($chan == NULL) $chan = 'SERVER';
   
    $lastmsgid = $this->getLastId($chan);
    $lastmsgid++;
    if ( $lastmsgid < time())
      $lastmsgid = time();
    $this->setMeta("channelid-to-msgid", $this->encode($chan), 'lastmsgid', $lastmsgid);
   
    return $lastmsgid;
  }

Losing track of the counter effectively shuts out all users from the open chat rooms.

EDIT: One other suggestion. Perhaps this isn't a file corruption issue? Maybe it's the webserver's fault? I know you were dilligent enough to add the proper meta tags to tell the web server NOT to perform any caching. However, it may not be enough for some configurations. I found this:

http://drupal.org/node/32109

I'm going to try it on my end to see if it makes any difference.
Last edited by King Moonraiser on Wed Aug 01, 2007 10:52 pm, edited 1 time in total.
King Moonraiser
Member
 
Posts: 98
Joined: Fri Jun 22, 2007 9:42 pm
  • Website
Top

Postby phpfreechat » Thu Aug 02, 2007 2:18 pm

Humm I don't understand your patch because $lastmsgid is very different from the current time().
$lastmsgid is just an integer that is increased +1 each time a message is posted.

However, I think some problems could occurs if two chatter post a message the exactly the same time:
The first chatter will execute "$lastmsgid = $this->getLastId($chan);" that will (for example) returns number 5. At the same time, the second chatter will also execute "$lastmsgid = $this->getLastId($chan);" so it will also returns number 5.
Then the first chatter will do a "$lastmsgid++;" and he will store his message with the 6 number. BUT the second chatter will also do a "$lastmsgid++;" and he will overwrite the first chatter message because the same id is used.
This scenario could occurs but anyway it will not break the msgid order: the msgid will continually increase but it should never come back to zero (thanks to your patchs on the corruptions problems).

So there is a potential bug, but just a small one because only one message is lost and the whole chat is already working (not frozen).
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby zovall » Thu Aug 30, 2007 4:29 pm

Hello,

I'm running into this problem with beta11. It looks like King Moonraiser and kerphi have come up with a solution.

How can I implement this into my beta11 version?

Thanks!
zovall
New member
 
Posts: 5
Joined: Thu Aug 23, 2007 6:40 pm
Top

Postby King Moonraiser » Thu Aug 30, 2007 9:37 pm

zovall wrote:Hello,

I'm running into this problem with beta11. It looks like King Moonraiser and kerphi have come up with a solution.

How can I implement this into my beta11 version?

Thanks!

Yes, it will be fixed in the next release along with a whole mess of other fixes/changes.

I have a recent pull from the Subversion server on SourceForge at: http://forums.rowdyruff.net/phpfreechat_tip.tgz you can download. It doesn't have an installer. You would need to upload it with FTP.

Keep in mind it's a pre-release, but it's very stable, IMHO.
King Moonraiser
Member
 
Posts: 98
Joined: Fri Jun 22, 2007 9:42 pm
  • Website
Top

Previous

Post a reply
21 posts • Page 2 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 3 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub