Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HTTPTrigger] Send 503 instead of 500 on processing rejected #1071

Open
csc-gip opened this issue Aug 16, 2024 · 0 comments
Open

[HTTPTrigger] Send 503 instead of 500 on processing rejected #1071

csc-gip opened this issue Aug 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@csc-gip
Copy link
Contributor

csc-gip commented Aug 16, 2024

/**
* called if no thread could be started to process filters.
*/
protected abstract void onProcessingRejected(String cause, I con);

String rejection = receiveControlAlgorithm.notifyReceive();
if( rejection != null ) {
onProcessingRejectedProxy(rejection, tc);
return null;

public String notifyReceive() {
long cnt = currentActiveEvents.incrementAndGet();
if ( maxReceives <= -1) {
return null; //unbegrenzte Receives
}
if( cnt > maxReceives ) {
return SERVER_LOAD_TOO_HIGH_MESSAGE;
}
return null;
}

public void onProcessingRejected(String s, HTTPTriggerConnection con) {
try {
rejectCounter.incrementAndGet();
con.sendError(s);

We should send the retryable error code 503 or 429 in case the max trigger events are reached instead of a non retryable 500
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

@csc-gip csc-gip added the enhancement New feature or request label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant