It's all about the answers!

Ask a question

Deferred Operation Failed with Multi-Threaded Client Application


Daniel Chirillo (111) | asked Mar 21 '22, 12:39 p.m.
edited Mar 21 '22, 12:45 p.m.
Context:  I'm developing an app that creates test cases using the REST API. It POSTs the test cases using the REST client that is part of the RQM Copy Utility. It is also multi-threaded -- there's a separate thread for each test case that is created.  Each thread has its own instance of the REST client.  The app creates and runs 10 threads at a time.

The Symptom: What I'm seeing is that, consistently, the QM server returns an http code of 412, an exception is thrown by the REST client (the exception message is State identifier null is stale) and in the QM server log I see a "deferred operation failed" message.  With a set of 160 test cases, around 3 threads run into this.  I've worked around the symptom by POSTing with retries.  This has so far worked.  I've haven't yet even seen any thread need to retry more than 1 once.


The question:  What does/could "deferred operation failed" mean in this context?  Is there a server setting I should be looking at?

One answer



permanent link
David Honey (1.2k17) | answered Mar 21 '22, 12:54 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
A 412 reponse is often use to indicate that a pre-condition fails. For example, when updating a resource, a client might:
  1. Perform a GET to fetch the RDF contents.
  2. Modify the RDF.
  3. Perform a PUT with If-match=etagFromTheGet with modified contents.
If some other thread modifies the same resource between steps 1 and 3, the etag will no longer match, and the response would be 412. With many Jazz applications, the etag is represented by a repository item state id. The message "State identifier null is stale" suggests the issue is that the state id of the content doesn't match the current state id.

However, in your usage, you're not doing that directly - you're using the RQM Copy Utility. I don't know that utility. Perhaps someone else on this forum can advise. Perhaps you can enable HTTP wire logging to see the exact HTTP requests and responses.

Comments
Daniel Chirillo commented Mar 21 '22, 1:02 p.m.
Thanks for the response.  I updated my description to include the exception message:  State identifier null is stale.

In my case, nothing is being updated.  It's just creation, so .... there is no risk of some artifact being out of sync with the server.  The exception message, though, is a bit... well...not clear ;) [thus the post to the forum]

Your answer


Register or to post your answer.