API hangs on converting MSG to MHTML (C# .NET)

Thanks for the info Mudassir,

Just to be clear - I’m not asking for performance improvements. The performance is fine when it works, which is the vast majority of the time. Unfortunately there are some situations that arise where something goes wrong with MailMessage.Save(). Under these situations most of the time exceptions are thrown by Aspose.Email and all is fine but there is the odd occasion where your code just hangs, we get no exception and the CPU usage goes off the chart whilst MailMessage.Save() is being executed. We just get a hung execution when I would expect the Aspose software to at least timeout and throw an exception.

@Drammy,

I can understand your concerns in this. However, in order to proceed further with implementing a mechanism of even throwing exception in such a case, we need a sample code and particular source file that is reproducing the issue on saving. Please share this information so that we may be able to further investigate it.

I would love to be able to provide a sample project but the problem we have is… we’re dealing with a law firms confidential documents. We can’t provide these as sample documents as they aren’t our documents to give and they contain confidential information.

We tested 20.5 last night and the problem area has shifted with the same net effect - hanging code.

Previously it was the MailMessage.Save() method that was hanging and on log tracing through the code it is actually the Words.Document.Save() method that is hanging now.

To be clear - our app is converting documents of numerous different types into PDF. For emails they are opened, saved to MHTML, the MHTML is then opened as a Word Document which is then saved to PDF. It is this saving from Word Document to PDF that is now hanging.

Do I need to log a separate forum post in the Aspose.Word section?

@mudassir.fayyaz Do you have any alternate options for how we can proceed? Like I said I can’t send you the files. :frowning:

@Drammy,

I can understand your concerns. The issue that you have referred is related to some particular files and unfortunately without provision of requested information we may not be able to investigate the issue as we don’t have any source information. You can even share the files privately even with me using Private Message option if it is allowed for you and they will never be public.

Hi @mudassir.fayyaz

Hope you enjoyed the weekend.
I’ve DM’ed you an obfuscated email and sample project; hope that helps.

@Drammy,

Thank you for sharing the information. I have been able to reproduce the issue. An issue with ID EMAILNET-39850 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Ok thanks, I’ll look forward to hearing an update.

@Drammy,

We will update you as soon as issue will be fixed.

We’ve got another hanging issue when opening PDFs and converting to PDF/A as well now
:frowning:

@Drammy

If you are trying to open PDF and having issue converting that to PDF/A then I suggest you to please make a separate inquiry in Aspose.PDF forum with sample PDF and sample code used.

Hello, I have encountered some more MSG files that hang when doing a simple conversion to MHTML, using the latest Aspose.Email for .NET (20.6) with the same code as above:

var mapi = Aspose.Email.Mapi.MapiMessage.FromFile("input.msg");
var msg = mapi.ToMailMessage(new Aspose.Email.Mapi.MailConversionOptions());
var saveOpts = new Aspose.Email.MhtSaveOptions();     
msg.Save("output.mhtml", saveOpts);  // <-- never finishes

Sample file: input.zip (101.2 KB)

Can you please fix this, as it is a problem when the whole process hangs on random emails.
Thanks

@ast3,

The new file appears to hang on saving to MHTML. A ticket with ID EMAILNET-39873 has been created to further investigate and resolve the issue. We will share the good news with you as soon as the issue will be fixed.

@mudassir.fayyaz
We seem to be going round in circles finding individual issues and fixing them. My request is that after a specified period the save will timeout instead of hanging your customers applications.

We’ve had to implement a timeout function using sub-processes which has absolutely destroyed our performance, mainly due to having to license Aspose on each sub-process execution. We shouldn’t need to go to such measures just to make sure our application doesn’t go into a zombie state.

I understand your developers need to fix these individual problems but can you confirm if the developers are looking to ensure the code never hangs?

@Drammy,

I can understand your concerns. However, the issue of hanging is not related to single situation in API. In MHTML export multiple APIs are involved. For example, in case of EMAILNET-39850, the issue happened in with Aspose.Words on saving MHTML rather than Aspose.Email. and we have added a new ticket with ID WORDSNET-20729 to address that.

@mudassir.fayyaz,

I understand that may be the case but from our point of view there are two main touchpoint where we experience zombie states - loading and saving on aspose libraries…
My request is that you add some catches in these methods to prevent hanging code. Without proper timeouts implemented we lose faith in your great libraries, just waiting for the next time we try to load or save a document with some unknown element in it that causes a hang. Like I said, the code we HAD to implement to work around the zombie state some of the load and save methods can cause has destroyed our conversion performance and it makes us start to look elsewhere for alternatives, which we don’t want to do.

@Drammy,

You are very right in your observation and points. However, from our perspective whenever we receive any reported case, its root cause is investigated and fixed. Apparently the symptoms of issue are same on surface level but deep inside they have several testicles. Like consider the last case where apparently the issue of hanging was same but when it was investigated, it was found to be related with Aspose.Words. We encounter situations during our development and some are reported via customers. We tend to consider and resolve all.

@mudassir.fayyaz,

I’m not suggesting you don’t investigate individual issues; I absolutely think that should continue and we will continue to contribute in the effort to improve the variety of documents you can support.

The problem is, as customers, we need the Aspose libraries to do something other than hang and go into a zombie state upon an issue like those found here; a timeout is a possible solution but your developers may well be able to come up with a better solution. At least our applications can then complete without us having to find individual documents that failed, exclude them and then restart processing. It just leaves a bad taste in the mouth when paying thousands to use your libraries only to find they can hang our apps.

On receiving a timeout exception we can then report individual documents to Aspose as and when they occur.

@Drammy,

Based on your request, I have created an investigation ticket with ID EMAILNET-39876 in our issue tracking system to further assess the requirements. We will share the feedback with you as soon as it will be share by team…