patrickfrey / strusWebService

web service (HTTP/JSON) to use the strus API as a service
http://project-strus.net
Mozilla Public License 2.0
4 stars 0 forks source link

[CLOSED] error handling is bricolage #8

Closed andreasbaumann closed 6 years ago

andreasbaumann commented 6 years ago

Issue by andreasbaumann Saturday Apr 16, 2016 at 18:20 GMT Originally opened as https://github.com/Eurospider/strusWebService/issues/8


we write messages in a temporary file which we rewind on error output. we should use string buffers only. can we pass a NULL as file pointer to the ErrorHandler of strus?

andreasbaumann commented 6 years ago

Comment by patrickfrey Saturday Apr 16, 2016 at 22:01 GMT


You can pass a NULL file pointer. Then nothing is logged. One important thing to note here is that the error buffer defines its context by thread-id. In an environment with coroutines other other form of cooperative context switching, tasks may share the thread-id, when executed by the same thread. In this case you have to check the error buffer for errors and fetch them before cooperative context switching. Otherwise error messages might jump from one task to an other.

andreasbaumann commented 6 years ago

Comment by andreasbaumann Sunday Apr 17, 2016 at 07:03 GMT


I was under the false impression to get more if I read the logfile, this is not the case (looking at the implementation of ErrorBuffer).

As for parallel execution I have to make a stress test to see whether my current solution holds.

andreasbaumann commented 6 years ago

Comment by andreasbaumann Thursday May 12, 2016 at 15:50 GMT


fixed.