-
Notifications
You must be signed in to change notification settings - Fork 205
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
[DPP-701] Maybe missed error code conversions #11510
[DPP-701] Maybe missed error code conversions #11510
Conversation
@@ -72,6 +72,7 @@ object ScenarioServiceMain extends App { | |||
|
|||
object ScenarioService { | |||
private def notFoundContextError(id: Long): StatusRuntimeException = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Here and other places helpfully annotated with "Language team" by Tudor)
@remyhaemmerle-da We spotted these places that could need adapting to self service error codes (aka V2). Are you aware of these in the Language team (if there're legitimate)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scenarios will die completely in Daml 2.0, safe to ignore.
@@ -292,8 +293,10 @@ class ScenarioService(implicit | |||
|
|||
} catch { | |||
case e: archive.Error => | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
respObs.onError(Status.INVALID_ARGUMENT.withDescription(e.msg).asRuntimeException()) | ||
case NonFatal(e) => | ||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
@@ -439,6 +439,7 @@ class JsonLedgerClient( | |||
// TODO (MK) Using a grpc exception here doesn’t make that much sense. | |||
// We should refactor this to provide something more general. | |||
Future.successful( | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language or runtime team?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanobaghino-da @remyhaemmerle-da We spotted this place that could need adapting to self service error codes (aka V2). Are you aware of this in the Language or Runtime team (if it's legitimate)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language or runtime team?
Language is responsible from this part of the script. @stefanobaghino-da you can ignore this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can ignore this one.
cc @cocreature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that’s fine, just keep it
...ings-rxjava/src/test/scala/com/daml/ledger/rxjava/grpc/helpers/TransactionsServiceImpl.scala
Show resolved
Hide resolved
@@ -191,6 +191,7 @@ class RejectionGenerators(conformanceMode: Boolean) { | |||
// TODO error codes: This converter is deprecated and should be removed | |||
// Instead of using this, construct proper validation errors in callers of this method | |||
// and only convert to StatusRuntimeExceptions when dispatched (e.g. in ApiSubmissionService) | |||
@deprecated("not used in daml sdk") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -78,6 +78,7 @@ class BatchedValidatingCommitter[LogResult]( | |||
Future.successful(SubmissionResult.Acknowledged) | |||
case Failure(exception) => | |||
Future.successful( | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KV Committer team
@@ -121,13 +121,15 @@ case class DefaultBatchingQueue( | |||
) | |||
) | |||
case f: QueueOfferResult.Failure => | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KV committer team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Here and other places helpfully annotated with "KV committer team" by Tudor)
@fabiotudone-da We spotted these places that could need adapting to self service error codes (aka V2). Are you aware of these in the Committer team (if there're legitimate)?
SubmissionResult.SynchronousError( | ||
Status( | ||
Code.INTERNAL.value, | ||
f.toString, | ||
) | ||
) | ||
case QueueOfferResult.QueueClosed => | ||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KV committer team
@@ -65,13 +65,15 @@ class ValidatingCommitter[LogResult]( | |||
postCommit(value) | |||
SubmissionResult.Acknowledged | |||
case Left(MissingInputState(keys)) => | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KV committer team
SubmissionResult.SynchronousError( | ||
Status( | ||
Code.INTERNAL.value, | ||
s"Missing input state: ${keys.map(_.bytes.asScala.map("%02x".format(_)).mkString).mkString(", ")}", | ||
) | ||
) | ||
case Left(ValidationError(reason)) => | ||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KV committer team
.../sandbox-classic/src/main/scala/platform/sandbox/stores/ledger/inmemory/InMemoryLedger.scala
Show resolved
Hide resolved
@@ -44,6 +44,7 @@ class SandboxResetService( | |||
serverCallHandler: ServerCallHandler[ReqT, RespT], | |||
): Listener[ReqT] = { | |||
if (resetInitialized.get) { | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
@@ -71,6 +72,7 @@ class SandboxResetService( | |||
logger.info("Initiating server reset.") | |||
|
|||
if (!resetInitialized.compareAndSet(false, true)) | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
@@ -261,6 +261,7 @@ object ReadWriteServiceBridge { | |||
) | |||
case QueueOfferResult.Failure(throwable) => | |||
logger.error("Error enqueueing new submission.", throwable) | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
@@ -269,6 +270,7 @@ object ReadWriteServiceBridge { | |||
) | |||
case QueueOfferResult.QueueClosed => | |||
logger.error("Error enqueueing new submission: queue is closed.") | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
@@ -332,6 +332,7 @@ private[platform] object Conversions { | |||
import RejectionReasonOps._ | |||
|
|||
def toParticipantStateRejectionReason: state.Update.CommandRejected.RejectionReasonTemplate = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team: used in sandbox-classic
@@ -49,6 +49,7 @@ private[services] final class QueueBackedTracker( | |||
_.left.map(completionFailure => QueueCompletionFailure(completionFailure)) | |||
) | |||
case QueueOfferResult.Failure(t) => | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me
@@ -85,6 +85,7 @@ object CompletionResponse { | |||
} | |||
|
|||
private[daml] def toException(response: TrackedCompletionFailure): StatusException = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like all command-tracker stuff, it is incorporated both into the ledger-api-server and the client code. As such we need to keep the runtime team in the loop.
@stefanobaghino-da FYI
@@ -115,6 +116,7 @@ object CompletionResponse { | |||
|
|||
private def buildException(metadata: Map[String, String], status: StatusJavaProto.Builder) = { | |||
val details = mergeDetails(metadata, status) | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
@@ -28,6 +28,7 @@ object SubmissionResult { | |||
override val description: String = s"Submission failed with error ${status.message}" | |||
|
|||
def exception: StatusRuntimeException = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are already getting a Status, expecting that the WriteService
is returning self-service error code formatted statuses. I'll look into it, thanks 👍
@@ -28,6 +28,7 @@ object Rejection { | |||
domain.RejectionReason.InvalidLedgerTime(description) | |||
|
|||
override lazy val toStateRejectionReason: state.Update.CommandRejected.RejectionReasonTemplate = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Participant team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiotudone-da, @remyhaemmerle-da, @stefanobaghino-da - Could you have a look? I mentioned you in the relevant comments.
@@ -121,13 +121,15 @@ case class DefaultBatchingQueue( | |||
) | |||
) | |||
case f: QueueOfferResult.Failure => | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Here and other places helpfully annotated with "KV committer team" by Tudor)
@fabiotudone-da We spotted these places that could need adapting to self service error codes (aka V2). Are you aware of these in the Committer team (if there're legitimate)?
@@ -72,6 +72,7 @@ object ScenarioServiceMain extends App { | |||
|
|||
object ScenarioService { | |||
private def notFoundContextError(id: Long): StatusRuntimeException = | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Here and other places helpfully annotated with "Language team" by Tudor)
@remyhaemmerle-da We spotted these places that could need adapting to self service error codes (aka V2). Are you aware of these in the Language team (if there're legitimate)?
@@ -439,6 +439,7 @@ class JsonLedgerClient( | |||
// TODO (MK) Using a grpc exception here doesn’t make that much sense. | |||
// We should refactor this to provide something more general. | |||
Future.successful( | |||
// TODO error codes: Adapt V2 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanobaghino-da @remyhaemmerle-da We spotted this place that could need adapting to self service error codes (aka V2). Are you aware of this in the Language or Runtime team (if it's legitimate)?
@pbatko-da We've decided not to port batching-related errors to V2 as now we only use pre-execution. CC @miklos-da |
Thanks for the comments. To sum up:
|
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.