Snapshot deployed ...
On Mar 5, 2013, at 3:55 PM, Khai Do wrote:
> Hi Eric. I have verified this fix. It works exactly as i expect.
> Thanks for the detailed info because i'm experiencing the same problem
> when I use the python client with this worker. Please do your release
> so I can pickup from the repo. Thanks!
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1126496
>
> Title:
> worker always returns an empty string for Warnings and Exceptions
>
> Status in Gearman Java:
> Fix Committed
>
> Bug description:
> It looks like the worker always returns an empty string for
> getExceptions() and getWarnings(). It doesn't matter whether the
> worker function succeeded or failed.
>
> I used the reverse worker and client examples to test...
>
> Worker:
>
> public class ReverseFunction extends AbstractGearmanFunction {
>
> @Override
> public GearmanJobResult executeFunction() {
>
> boolean jobResult = false;
>
> RuntimeException re = new RuntimeException("job Failed!");
> String warningMsg = "Test the warning";
>
>
> StringBuffer sb = new StringBuffer(ByteUtils.fromUTF8Bytes((byte[]) this.data));
>
> // tested by throwing an exception but still do not get warnings or exceptions on client side
> // throw re;
>
> GearmanJobResult gjr = new GearmanJobResultImpl(this.jobHandle,
> jobResult, sb.reverse().toString().getBytes(),
> warningMsg.getBytes(), re.toString().getBytes(), 0, 0);
> return gjr;
> }
> }
>
>
> Client:
>
>
> public String reverse(String input) {
> String function = ReverseFunction.class.getCanonicalName();
> String uniqueId = null;
> byte[] data = ByteUtils.toUTF8Bytes(input);
> GearmanJobResult res = null;
> GearmanJob job = GearmanJobImpl.createJob(function, data, uniqueId);
> String value = "";
> String valueWarn = "";
> String valueEx = "";
>
>
> client.submit(job);
>
> try {
> res = job.get();
> if (res.jobSucceeded()){
> value = ByteUtils.fromUTF8Bytes(res.getResults());
> valueEx = ByteUtils.fromUTF8Bytes(res.getExceptions());
> valueWarn = ByteUtils.fromUTF8Bytes(res.getWarnings());
> } else {
> value = ByteUtils.fromUTF8Bytes(res.getResults());
> valueEx = ByteUtils.fromUTF8Bytes(res.getExceptions());
> valueWarn = ByteUtils.fromUTF8Bytes(res.getWarnings());
>
> }
> } catch (Exception e) {
> e.printStackTrace(); //NOPMD
> }
>
> String resultMsg = value.toString()+","+valueWarn.toString()+","+valueEx.toString();
> return resultMsg; // never get anything for res.getWarnings() or res.getExceptions()
> }
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gearman-java/+bug/1126496/+subscriptions
Snapshot deployed ...
On Mar 5, 2013, at 3:55 PM, Khai Do wrote:
> Hi Eric. I have verified this fix. It works exactly as i expect. /bugs.launchpad .net/bugs/ 1126496 Function { n("job Failed!"); ByteUtils. fromUTF8Bytes( (byte[] ) this.data)); tImpl(this. jobHandle, ).toString( ).getBytes( ), getBytes( ), re.toString( ).getBytes( ), 0, 0); .class. getCanonicalNam e(); toUTF8Bytes( input); createJob( function, data, uniqueId); ed()){ fromUTF8Bytes( res.getResults( )); fromUTF8Bytes( res.getExceptio ns()); fromUTF8Bytes( res.getWarnings ()); fromUTF8Bytes( res.getResults( )); fromUTF8Bytes( res.getExceptio ns()); fromUTF8Bytes( res.getWarnings ()); ce(); //NOPMD )+","+valueWarn .toString( )+","+valueEx. toString( ); /bugs.launchpad .net/gearman- java/+bug/ 1126496/ +subscriptions
> Thanks for the detailed info because i'm experiencing the same problem
> when I use the python client with this worker. Please do your release
> so I can pickup from the repo. Thanks!
>
> --
> You received this bug notification because you are a bug assignee.
> https:/
>
> Title:
> worker always returns an empty string for Warnings and Exceptions
>
> Status in Gearman Java:
> Fix Committed
>
> Bug description:
> It looks like the worker always returns an empty string for
> getExceptions() and getWarnings(). It doesn't matter whether the
> worker function succeeded or failed.
>
> I used the reverse worker and client examples to test...
>
> Worker:
>
> public class ReverseFunction extends AbstractGearman
>
> @Override
> public GearmanJobResult executeFunction() {
>
> boolean jobResult = false;
>
> RuntimeException re = new RuntimeExceptio
> String warningMsg = "Test the warning";
>
>
> StringBuffer sb = new StringBuffer(
>
> // tested by throwing an exception but still do not get warnings or exceptions on client side
> // throw re;
>
> GearmanJobResult gjr = new GearmanJobResul
> jobResult, sb.reverse(
> warningMsg.
> return gjr;
> }
> }
>
>
> Client:
>
>
> public String reverse(String input) {
> String function = ReverseFunction
> String uniqueId = null;
> byte[] data = ByteUtils.
> GearmanJobResult res = null;
> GearmanJob job = GearmanJobImpl.
> String value = "";
> String valueWarn = "";
> String valueEx = "";
>
>
> client.submit(job);
>
> try {
> res = job.get();
> if (res.jobSucceed
> value = ByteUtils.
> valueEx = ByteUtils.
> valueWarn = ByteUtils.
> } else {
> value = ByteUtils.
> valueEx = ByteUtils.
> valueWarn = ByteUtils.
>
> }
> } catch (Exception e) {
> e.printStackTra
> }
>
> String resultMsg = value.toString(
> return resultMsg; // never get anything for res.getWarnings() or res.getExceptions()
> }
>
> To manage notifications about this bug go to:
> https:/