james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tellier Benoit (JIRA)" <server-...@james.apache.org>
Subject [jira] [Created] (JAMES-2445) Adding/removing groups/forwards should be indempotent
Date Mon, 02 Jul 2018 05:16:00 GMT
Tellier Benoit created JAMES-2445:
-------------------------------------

             Summary: Adding/removing groups/forwards should be indempotent
                 Key: JAMES-2445
                 URL: https://issues.apache.org/jira/browse/JAMES-2445
             Project: James Server
          Issue Type: Test
          Components: webadmin
    Affects Versions: master
            Reporter: Tellier Benoit


h2. Description

Got that log:


{code:java}
{
  "_index": "logs-2018-06-27",
  "_type": "tester",
  "_id": "AWRBhCZB8lYUhR3VshEu",
  "_score": 1,
  "_source": {
    "@timestamp": "2018-06-27T13:52:16.762Z",
    "message": "",
    "protocol": "webadmin",
    "ip": "127.0.0.1",
    "host": "james.openpaas.linagora.com",
    "verb": "PUT",
    "action": "/address/groups/team-hanoi@linagora.com/sngodoan@linagora.com",
    "user": "linagora.esn.james",
    "severity": "ERROR",
    "thread": "qtp54858514-136",
    "stacktrace": "org.apache.james.rrt.api.RecipientRewriteTableException: Mapping Mapping{type=Group
mapping=sngodoan@linagora.com} for team-hanoi@linagora.com already exist!\n\tat org.apache.james.rrt.lib.AbstractRecipientRewriteTable.checkDuplicateMapping(AbstractRecipientRewriteTable.java:316)\n\tat
org.apache.james.rrt.lib.AbstractRecipientRewriteTable.addGroupMapping(AbstractRecipientRewriteTable.java:284)\n\tat
org.apache.james.webadmin.routes.GroupsRoutes.addToGroup(GroupsRoutes.java:166)\n\tat spark.RouteImpl$1.handle(RouteImpl.java:72)\n\tat
spark.http.matching.Routes.execute(Routes.java:61)\n\tat spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:130)\n\tat
spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1568)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
org.eclipse.jetty.server.Server.handle(Server.java:561)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:334)\n\tat
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)\n\tat
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)\n\tat org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:243)\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)\n\tat
java.lang.Thread.run(Thread.java:748)\n",
    "logger": "spark.http.matching.GeneralError"
  },
  "fields": {
    "@timestamp": [
      1530107536762
    ]
  }
}
{code}

Which resulted in a **500** HTTP error.

h2. Expected result


We should be indempotent. We should have returned **204** because at the end of that call,
the resource exist!

h2. Current behaviour

A nasty **500** error.

h2. Acceptance criteria

Route level test while adding a recipient that already exist.

Please note that some implems might throw, some might not. If needed we might need to mockito-spy
to force the memory implem to throw in new tests.

We do have to check this for:
 - Groups
 - Forwards
 - Domain redirections



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message