login about faq

Using IMAP Chilkat 9.4.1 (either x86 or x64) on Production as part of a Windows Service - Few days after starting the service, the service seems to be stuck, consuming 100% CPU, all the time. Basically, the service connects to an Email Provider and parses emails.

For example, it uses this sample: http://www.example-code.com/csharp/imap_markAsRead.asp

I've tried calling Dispose() and assigning the Imap Connection object to null, as well as using GC.Collect(). Nothing seems to work.

The service itself can be multi-threaded - each thread has its own Imap Connection object.

Also, I've tried using only 1 thread - and it still hangs.

The service doesn't use much RAM - only CPU issue.

What could be the issue here?

Additional information: As suggested, I'm running debug logger with Chilkat.

In the meantime, at the service application logs every time it hangs - the log stops at a specific point: several milliseconds right after disconnecting from the Mail Server (Google is the mail service provider). Code Sample where it seems to hang according to the application service logs:

        if (imapCon != null)
        {
            if (imapCon.IsLoggedIn())
            {
                imapCon.Logout();
            }

            if (imapCon.IsConnected())
            {
                imapCon.Disconnect();
            }

            imapCon.Dispose();
            imapCon = null;  
        }

[IMAP CHILKAT DEBUG LOGS] Updating Logs - We use an Amazon VM and VPC and the network might fail, but the Chilkat code should not get stuck on 100% CPU - please review the following information from the Chilkat debug logs - the service reached 100% CPU and got stuck:

ListMailboxes:

DllDate: May  6 2014

ChilkatVersion: 9.5.0.38

UnlockPrefix: SNILIKIMAPMAIL

Username: WIN-OCJD4A0985E:SYSTEM

Architecture: Little Endian; 64-bit

Language: .NET 4.5 / x64

VerboseLogging: 0

listMailboxes:

    bSubscribedOnly: 0

   reference:

    mailbox: *

    Escaping quotes and backslashes in mailbox name...

    utf7EncodedMailboxPath: *

    getCompleteResponse:

            WindowsError: An established connection was aborted by the software in your host machine.

            WindowsErrorCode: 0x2745

            numBytesRequested: 5

            Failed to receive data on the TCP socket

            Failed to read beginning of SSL/TLS record.

            Failed to read incoming handshake messages. (3)

            (leaveContext)

        Client handshake failed. (3)

        (leaveContext)

    ConnectFailReason: 0

    (leaveContext)

failReason: 0

connect failed.

(leaveContext)

Login:

DllDate: May  6 2014

ChilkatVersion: 9.5.0.38

UnlockPrefix: SNILIKIMAPMAIL

Username: WIN-OCJD4A0985E:SYSTEM

Architecture: Little Endian; 64-bit

Language: .NET 4.5 / x64

VerboseLogging: 0

login: ******************

ConnectionType: SSL/TLS

Error sending on socket (1)

SocketError: WSAECONNABORTED An established connection was aborted by the software in your host machine.

For more information see this Chilkat Blog post: http://www.cknotes.com/?p=91

send_size: 90

Failed to send TLS message.

Failed to send LOGIN command

Failed.

asked Apr 17 '14 at 07:44

lionheart's gravatar image

lionheart
16124

edited May 18 '14 at 04:55


You'll need to do some basic debugging of your Windows Service to determine whether the 100% CPU utilization and hang occurs within a Chilkat method call or not. If NOT, then it's just your Windows Service this is spinning its wheels. If it is within Chilkat, (1) test with the latest version (v9.5.0) and (2) use the DebugLogFilePath property to find out what's going on within the particular call that spins/hangs.

link

answered Apr 17 '14 at 09:59

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

I edited the question with more information - the issue continues... Going through the logs, it seems as a network queue-handling issue, though we have other machines that work with a lot of data transfer - and we never had this kind of issue with other services, using different SDKs. Is this an issue with how IMAP is implemented and/or network infrastructure?

(May 19 '14 at 00:48) lionheart
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×174
×7

Asked: Apr 17 '14 at 07:44

Seen: 1,983 times

Last updated: May 19 '14 at 00:48

powered by OSQA