Questions tagged [fail-fast]

Anything related to fail-fast error management strategy, i.e. that software design principle requiring that in case of error a unit of code encapsulation (a module, a function, a method, etc.) should fail in the shortest possible time, reporting a failure to its client code in a clear and unambiguous way.

51 questions
1
vote
2 answers

bash on ubuntu 16: set -e not inheriting inside subshell

When I run this command set -e; echo $(echo "$-"); I get himBH as the output. I was expecting the letter e to be included in the output. Whats going on? I'm on Ubuntu 16.04.1 LTS with GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
american-ninja-warrior
  • 7,397
  • 11
  • 46
  • 80
1
vote
0 answers

How do I throw an exception when I get multiple elements but I'm supposed to get only one?

I'm worried about this code: knex('person').where('id','=', 1).then(result => { const person = result[0]; // the code I worry - result should contain only ONE element }); If I was using C#, I would use Linq's Single, it would fail fast and…
Hao
  • 8,047
  • 18
  • 63
  • 92
1
vote
0 answers

Webservice functional/integration test with Junit

The question aims to find a better solution than mine. I have the following REQUIREMENTS for my integration tests: Each integration test is implemented in a single test class. The methods in a test class have to be executed in order. Each method is…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
1
vote
0 answers

Spring Batch: OutOfMemoryError swallowed

As part of a larger application, I set up a Spring Batch job that is made up by just a chunk oriented tasklet: reader, processor and writer. The job is not run in the main thread. Occasionally the tasklet code throws an OutOfMemoryError. So, I set…
danidemi
  • 4,404
  • 4
  • 34
  • 40
1
vote
1 answer

Why is generic instantiation syntax disallowed in Hack?

From the docs: Note: HHVM allows syntax such as $x = Vector{5,10};, but Hack disallows the syntax in this situation, instead opting to infer it. Is there a specific reason for this? Isn't this a violation of the fail-fast rule? There are…
Maciej Sz
  • 11,151
  • 7
  • 40
  • 56
1
vote
4 answers

Does a Java container offer a fail-safe iterator

Here is my problem: This piece of code throws a java.util.ConcurrentModificationException, because the Vector listeners is modified while there exists an Iterator for this data structure. The java-doc says that this container offers only a…
nutario
  • 773
  • 1
  • 9
  • 15
1
vote
3 answers

disabling "joining" when process shuts down

Is there a way to stop the multiprocessing Python module from trying to call & wait on join() on child processes of a parent process shutting down? 2010-02-18 10:58:34,750 INFO calling join() for process procRx1 I want the process to which I sent a…
jldupont
  • 93,734
  • 56
  • 203
  • 318
1
vote
2 answers

Design by Contract and Fail Fast

Fail Fast - Fail-fast is a property of a system or module with respect to its response to failures. A fail-fast system is designed to immediately report at its interface any failure or condition that is likely to lead to failure. Fail-fast…
1
vote
0 answers

Detect if Serializable object is really serializable?

Is there a built-in method - or can someone point me to a good pattern - for determining whether an object that implements Serializable is actually serializable at construction time? I need something that doesn't have side effects, so I can't just…
Matt Mills
  • 8,692
  • 6
  • 40
  • 64
0
votes
1 answer

Crash C# Application and Generate Dumps

I'm trying to generate dumps for my C# application, I used the FailFast method to "Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and optional exception information in…
dxtr
  • 685
  • 1
  • 7
  • 16
0
votes
2 answers

Fail Fast When Kafka Consumer Can't Connect

For my own purposes, I need the Spring Boot application to stop if the Kafka Consumer can't connect to the broker. I mean, when Kafka Consumer trying to pool messages, we can see the following logs: [Consumer clientId=consumer-ddddd-1,…
Oleksandr
  • 450
  • 1
  • 6
  • 13
0
votes
1 answer

How can I make JAXB to fail when a mandatory element is missing?

I'm trying to add some forward compatibility to a Java application calling a Web Service at work, but JAXB seems to behave backward on the subject... The application use the wsdl2java Maven plugin to generate a CXF Web Service client from a WSDL. It…
CidTori
  • 351
  • 4
  • 17
0
votes
1 answer

How to stop existing request execution to stop and just run fallback method in hystrix

In hystrix,I am using execution.isolation.thread.timeoutInMilliseconds this configuration to limit the response in some specific time else go for fallback method,But this setting is also executing the request which was invoked in the backend.Is it…
0
votes
1 answer

Fail Safe Fail Fast Example

ConcurrentHashMap hm = new ConcurrentHashMap<>(); hm.put("1", 1); hm.put("2", 2); hm.put("3", 3); Iterator itr = hm.keySet().iterator(); while(itr.hasNext()){ String key = itr.next(); …
VKN
  • 1
  • 2
0
votes
2 answers

Multiple threads using iterator.remove() on a single collection returning fail-fast iterator

Oracle says Note that Iterator.remove is the only safe way to modify a collection during iteration; the behavior is unspecified if the underlying collection is modified in any other way while the iteration is in progress. Could this mean that…