C-Gate stops responding on port 20023

Discussion in 'C-Bus Toolkit and C-Gate Software' started by more-solutions, Jul 24, 2011.

  1. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    A couple of times in the office whilst experimenting, but now once on site on a live application, I've had C-Gate stop responding on port 20023. Eg I can telnet in and establish a connection, but I get no connection message from C-Gate and cannot send C-Gate commands. I have to restart C-Gate to fix this.

    Any suggestions as to what might cause this?

    I'm pretty sure it's something wrong in my application logic, eg opening too many concurrent connections or not closing them properly, I'm just looking for hints as to where to go looking.
     
    more-solutions, Jul 24, 2011
    #1
  2. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    C-Gate exceptions

    This may or may not be relevant - looking in exception.info I'm finding a lot of these:

    Code:
    -***- C-Gate Server Exception -***-
    Version:   v2.8.0 (build 2309)
    Time:      Sat Jul 23 15:40:26 BST 2011
    Thread:    Thread[Thread-1163,4,CGateThreadGroup]
    Group:     CGateThreadGroup
    Exception: java.lang.NullPointerException
    Stack Details Below:
    java.lang.NullPointerException
            at com.clipsal.cgate.cbus.dev.CBusRELDN8Unit.a(ProGuard:67)
            at com.clipsal.cgate.cbus.dev.CBusDinProOutputUnit.u(ProGuard:251)
            at com.clipsal.cgate.cbus.dev.CBusDinProOutputUnit.p_(ProGuard:573)
            at com.clipsal.cgate.cbus.core.CBusUnit.W(ProGuard:758)
            at com.clipsal.cgate.cbus.core.CBusUnit.X(ProGuard:832)
            at cG.w(ProGuard:1567)
            at cG.ai(ProGuard:4394)
            at cz.r(ProGuard:224)
            at cz.p(ProGuard:181)
            at cz.e(ProGuard:135)
            at bl.run(ProGuard:21)
    
    By "a lot", I mean approx 64/day fairly well spread through the day, anything between 1 and 4 times per hour.

    I don't think these are related as they span a large period of time whilst C-Gate was responding fine, but they appear to have stopped yesterday afternoon exactly at the point that I restarted C-Gate.
     
    more-solutions, Jul 24, 2011
    #2
  3. more-solutions

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    The "CBusRELDN8Unit" exceptions are a known issue that was fixed as of Toolkit 1.11.6, C-Gate 2.8.0 build 2316, released 6 June 2011.

    I doubt they are the cause of the "stops responding" problem, but if you upgrade your C-Gate you can least rule that out.
     
    daniel, Jul 25, 2011
    #3
  4. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    That's odd, I thought I'd got the latest on there but it seems I'm way off!

    I'll upgrade and see what happens, but like you I doubt this is the cause.

    I'd appreciate any hints as to where to go looking in my application code though. As the system is "live" I'm going to have to put a workaround in (eg restarting cgate every night) while I try to debug this, and reproducing it off-site is going to be hard. If I know where to start looking I can push the application harder in those areas and see if I can make it break.
     
    more-solutions, Jul 25, 2011
    #4
  5. more-solutions

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    I really don't have much to go on, all I can suggest is that you turn on level 9 logging if you haven't already.

    When this happens, can you tell if any of the existing connections to and from C-Gate are still functioning?

    Has the problem occurred while C-Gate is connected to a PCI, CNI, both or neither?
     
    Last edited by a moderator: Jul 26, 2011
    daniel, Jul 26, 2011
    #5
  6. more-solutions

    more-solutions

    Joined:
    Apr 23, 2006
    Messages:
    283
    Likes Received:
    4
    Location:
    Peterborough, UK
    I have enabled it but it's not happened since.

    We've had a discussion here about it and we're going to put some code in to attempt to connect on port 20023 and to restart C-Gate if it fails (or if it doesn't get C-Gate's welcome message).

    I'm not sure; we raised the same question here. To that end, my watchdog script will be something like:

    Code:
    top:
      connect (else log fault and restart cgate)
      wait 1min
      send NOP and check response (else log fault and restart cgate)
      close connection
      goto top
    In other words, once every minute we'll see if the existing connection still works, and if it does we'll drop the connection and see if we can reconnect. If/when it fails we should therefore know whether the existing connection was working first.

    Open to suggestions as to anything else we should try in that loop though.

    Only tested whilst connected through CNI.
     
    more-solutions, Jul 26, 2011
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.