Commit Graph

199 Commits

Author SHA1 Message Date
David Reiss
37dbfef478 Fix thrift_server to work with newest thrift_processor
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666483 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:01 +00:00
David Reiss
9f2a5d7799 Rename "alterl" to "erl".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:45 +00:00
David Reiss
f2e66c1cb7 Remove all of the old Erlang stuff in preparation for renaming alterl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666480 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:38 +00:00
David Reiss
13c4380347 Add a distdir rule to lib/erl/Makefile to make "make check" happy.
This is a gross hack because lib/erl isn't using automake,
but it is still in SUBDIRs.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665661 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:49 +00:00
David Reiss
1d106ae6f0 Add simple "check" and "distclean" targets to lib/erl/Makefile.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665655 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 22:00:06 +00:00
Christopher Piro
b6f18c20ee [thrift] Erlang build tweaks
Summary: fix the Makefile to use BSD-friendly find(1) and enable conditional building of the Erlang binding.  Contributed by Dan Sully (daniel@electricrain.com).

Reviewed By: eletuchy

Test Plan: builds


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665549 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 07:09:12 +00:00
eletuchy
6f3507c425 [thrift] erlang: fixing error logger for devious "not-quite-right" lists
Summary: ... a la dictionary

Reviewed By: cpiro

Test Plan: bin_trim of a dict with a stored integer value

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665531 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 23:50:21 +00:00
eletuchy
7d2ab9fd43 [thrift] erlang: dialyzer bug: binary protocol double type ...
Summary: ... needs to be specified as a float to work, since
         erlang's binary syntax default is "integer"

Reviewed By: cpiro

Test Plan: make dialyzer -j

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665529 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 19:56:52 +00:00
eletuchy
38d199b879 [thrift] erlang: dialyzer bug: bad usage of ++ operator on a non-list
Reviewed By: cpiro

Test Plan: make dialyzer -j

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665528 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 19:55:15 +00:00
eletuchy
f0cf2a3745 [thrift] erlang: dialyzer bug: tSocket reading of send_timeout preference
Reviewed By: cpiro

Test Plan: make dialyzer

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665526 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 19:27:41 +00:00
eletuchy
53e571968f [thrift] erlang dialyzer error
Summary: impossible pattern matches are never good

Reviewed By: cpiro

Test Plan: make dialyzer

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665525 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 18:38:42 +00:00
eletuchy
57fd32c796 [thrift] make erlang error logger more efficient
Summary: when omit_fmt is included

Reviewed By: cpiro

Test Plan: sanity checked a service to make sure it ran

Revert Plan: sure

Other Notes: TODO - make reconfiguration work with this


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665524 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 17:43:40 +00:00
eletuchy
7dc23bce4b [thrift] adding dialyzer to erlang library Makefile
Summary: ... because static analysis can find bugs

Reviewed By: cpiro

Test Plan: cd src ; make dialyzer -j
     gape in awe at errors

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665523 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 17:41:05 +00:00
eletuchy
efe64a6cc5 [thrift] making erlang thrift error logger slightly nicer for printing binaries
Reviewed By: cpiro

Test Plan: ran some services ... verified that they worked

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665522 13f79535-47bb-0310-9956-ffa450edef68
2008-02-27 16:31:01 +00:00
eletuchy
c81e82bc26 [thrift] don't do a reverse DNS lookup for every erlang thrift request
Reviewed By: cpiro

Test Plan: ran a server ... verified its debug messages no longer included
     hostnames

Notes: methinks this binding is not long for this world

Revert Plan: sure ... if you don't like your dns server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665505 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 12:11:29 +00:00
eletuchy
698713cf64 [thrift] better error handling and timeouts in tSocket code
Summary: default socket send timeout to 5seconds, not infinity.
         close the socket in case of an error.

Reviewed By: cpiro

Test Plan: ran a client for slow services
     and sanity checked other client code to make sure

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665504 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 11:44:00 +00:00
Christopher Piro
215ba5c310 [thrift] Erlang thrift_sup will exit if it can't bind to the given address
Summary: before it would complain and not exit.  that's not right.

Reviewed By: eletuchy

Test Plan: DEATH ENSUES

Revert Plan: sounds reasonable


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665490 13f79535-47bb-0310-9956-ffa450edef68
2008-02-20 08:19:38 +00:00
eletuchy
bd03e3e40e [erl-thrift] tiny change to exception message for tSocket:connect
Summary: calls integer_to_list on the port

Reviewed By: dreiss

Test Plan: connected a client to non-running server. oh noes, exception.

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665475 13f79535-47bb-0310-9956-ffa450edef68
2008-02-13 00:48:15 +00:00
David Reiss
0c90f6f8af Thrift: Whitespace cleanup.
Summary:
- Expanded tabs to spaces where spaces were the norm.
- Deleted almost all trailing whitespace.
- Added newlines to the ends of a few files.
- Ran dos2unix on one file or two.

Reviewed By: mcslee

Test Plan: git diff -b

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665467 13f79535-47bb-0310-9956-ffa450edef68
2008-02-06 22:18:40 +00:00
Christopher Piro
aa93451dbf [thrift] iolists and binaries in Erlang
Summary: three related changes:
 * for numeric types in tBinaryProtocol call effectful_write with binary(), not [char()]
 * tBinaryProtocol:writeString now takes either [char()], iolist(), or binary() ... now you can use any of the three where a Thrift string is required
 * tBufferedTransport now buffers by building an iolist() rather than Buffer++Data.  zomg.

Reviewed By: eletuchy

Test Plan: everything seems to work as usual, and binary() works as expected

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665447 13f79535-47bb-0310-9956-ffa450edef68
2008-01-30 01:39:01 +00:00
Christopher Piro
21db52de16 [thrift] fix thrift_logger.erl when show_pid option is enabled
Summary: this gets rid of a lot of messy useless output every time the error logger prints something

Reviewed By: eletuchy

Test Plan: works as expected

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665422 13f79535-47bb-0310-9956-ffa450edef68
2008-01-14 05:54:50 +00:00
Christopher Piro
26484fb7b1 [thrift] in erlang add {nodelay, true} and {reuseaddr, true} to gen_tcp socket options
Summary: for parity with the C++ implementation

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665415 13f79535-47bb-0310-9956-ffa450edef68
2008-01-08 03:14:19 +00:00
Christopher Piro
7ab31e4fd1 [thrift] add show_pid option to thrift.app.src (Erlang)
Summary: we've been using this option in our apps but we never added it to thrift's own config

Reviewed By: eletuchy

Test Plan: ok

Other Notes: contributed by Jason Ganetsky (jason@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665411 13f79535-47bb-0310-9956-ffa450edef68
2008-01-04 00:21:18 +00:00
Christopher Piro
a89cd7b03e [thrift] squelch crash reports in Erlang R12B-0
Summary: there's a new format for errors in R12B-0, so don't echo a crash report if it matches the new one

Reviewed By: eletuchy

Test Plan: completely unnecessary

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665400 13f79535-47bb-0310-9956-ffa450edef68
2007-12-19 00:00:39 +00:00
Christopher Piro
de11d85211 [thrift] gut Erlang exception handling
Summary: * move type field to tException from subclasses
          * add backtrace to tException
          * add oop:is_a
          * on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
          * all throws/exits to tException:throw which does the wrapping described above

Reviewed By: eletuchy

Test Plan: been using this code on my live server ^_^

Revert: OK


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 02:10:20 +00:00
Christopher Piro
10522a7f2b [thrift] fix-ups to Erlang thrift_logger
Summary:
 * no ?INFO for every oop:call ... way too expensive
 * unfactor symbol/1 ... it was that way for a reason apparently
 * upped crash report depth to 3

Reviewed By: eletuchy

Test Plan: /much/ less CPU eaten by logging

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665343 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:31 +00:00
Christopher Piro
c2e37c7a61 [thrift] change up Erlang crash reports, cleanups in t{,Binary}Protocol
Summary: crash reports aren't too important so don't be so verbose -- all the pertinent info shows up elsewhere anyway.  refactor while we're at it.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665342 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:30 +00:00
Christopher Piro
53b6ef670c [thrift] whole ball of whitespace normalizations in Erlang
Summary: ill-formatted comments, trailing whitespace, and (gasp) tabs: all pwned.  better now than later.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665339 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:28 +00:00
Christopher Piro
a1650fe55c [thrift] make open and close `effectful' in Erlang client
Summary: make uniform across all tTransports.  god i want `effectful' to go away dead.  soon.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665338 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:27 +00:00
Christopher Piro
3121c8271f [thrift] Erlang client receive socket options
Summary: we want {active, false}, etc. for client sockets.  make it so.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665337 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:26 +00:00
Christopher Piro
0d5cd8a6b9 [thrift] Erlang makefile includes to terse messages
Summary: filter out compiler path and flags and cruft

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665336 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:59 +00:00
Christopher Piro
6c74062262 [thrift] convert oop.erl errors and infos to macros
Summary: old-style error messages get switched over

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665335 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:58 +00:00
Christopher Piro
6c46f1a8c9 [thrift] gut Erlang Thrift configuration; start using get_env
Summary: I patterned some config stuff after iserve, but Erlang's built-in stuff is better

Reviewed By: gopher

Test Plan: works with recent ch server

Revert Plan: ok

Other Notes: default config given in thrift.app


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665307 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 09:47:15 +00:00
Christopher Piro
3b63fe4d3c [thrift] clean up error logging in Erlang
Summary: pushed all formatting out of thrift_error_logger.erl, reenable crash logs, standardize

Reviewed By: eletuchy

Test Plan: works with latest ch server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665305 13f79535-47bb-0310-9956-ffa450edef68
2007-10-19 21:34:31 +00:00
Christopher Piro
524c3ecef7 [thrift] make thrift_logger.erl more robust against badmatch
Summary: more robust logic theres

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: the precommit hooks should forbid out-of-towners from being cited as reviewers


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665301 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 05:15:33 +00:00
Christopher Piro
b6dcd2b595 [thrift] retool oop.erl, fix tBufferedTransportFactory.erl
Summary: oop.erl used to assume that an undef or function_clause meant a method wasn't defined, but sometimes a method does exist and an undef happens while it's executing.

Case in point, getTransport in tBufferedTransportFactory totally didn't work and instead of exiting, oop.erl fell back silently to tTransportFactory, so everywhere I thought I was talking to tBufferedTransport, I was talking directly to the tSocket.  borkborkbork.

Blame: all me baby

Reviewed By: eletuchy

Test Plan: channel server works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665299 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 01:11:46 +00:00
Christopher Piro
efd5eec211 [thrift] Erlang Thrift changes, take 3
Summary: svn ci missed a bunch of paths ... blew away the whole thing and copied from the git repo.  this is getting ridiculous.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665285 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 01:33:37 +00:00
Christopher Piro
68940295e1 [thrift] otpification and sane configuration for Erlang Thrift
Summary: a small victory in the neverending quest of OTPifying this binding -- search for config files in ./conf/ (relative to the cwd of the emulator).  for example, when you start the channel server, ./conf/{channel,thrift}.conf should exist.  better than having to recompile to change a configuration ... reconfig should take care of that in running code.

Test Plan: works with channel server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665284 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:35:12 +00:00
Christopher Piro
42fe4b9a3e [thrift] revert 61883
Summary: i suck at git/svn ... commited not enough and with no commitlog

Notes: YOU'RE DOING IT WRONG


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665283 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:24:07 +00:00
Christopher Piro
c7fd7639b7 Merge branch 'otp'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665282 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:05:04 +00:00
Christopher Piro
93a0664aff [thrift] spruce up Erlang binding for tonight's release
Summary:
 * got rid of most of the otp_base jonx ... save that for a future release unfortunately
 * cleaned up the tutorial server, added -erl to tutorial.thrift's shebang
 * made better README and TODO

Test Plan: checked out a copy, read my directions, built and ran the tutorial, and pretended that it didn't blow


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665273 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 06:23:33 +00:00
Christopher Piro
fa0c857370 [thrift] erlang: log more tTransportExceptions
Summary: all tTEs were being filtered from the logs; now just tTEs that come from connections closing are suppressed

Test Plan: logs my bug in channel server :)

Notes: adds logic to thrift_logger, not removes (bad news bears)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665199 13f79535-47bb-0310-9956-ffa450edef68
2007-08-11 01:15:57 +00:00
Christopher Piro
ee5988444f [thrift] handle timeouts and other errors gracefully (Erlang)
Reviewed By: iproctor

Test Plan: tutorial, channel

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665190 13f79535-47bb-0310-9956-ffa450edef68
2007-08-03 23:34:55 +00:00
Christopher Piro
c3c6c0c9c4 [thrift] make Erlang server noisy when handler has error
Summary: generate an error message at the server ... before only the client got the error

Reviewed By: iproctor

Test Plan: tutorial, channel server

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665187 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 23:42:12 +00:00
Christopher Piro
5b3a8f7a8b [thrift] improved error logging and handling for Erlang bindings
Summary:
 * custom, extensible error logger -- show only relevant stuff
 * clean up of errors in developer-supplied handler module
   now gives sane error messages and doesn't crash whole server
   (introduces tApplicationException_HANDLER_ERROR)
 * more precise catch in tErlProcessor (exits gracefully only if
   transport closes)

Reviewed By: iproctor

Test Plan: tutorial works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665186 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 22:27:37 +00:00
Christopher Piro
5f5fdf3a20 [thrift] maps, lists, sets, and service inheritance for Erlang
Reviewed by: cpiro

Test Plan: tested wit tutorial/tutorial.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665175 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 22:41:00 +00:00
Christopher Piro
ae1f10f8f2 [thrift] misc. Erlang codegen improvements, cleanups
Summary:
 * const/enum namespacing
 * better formatting, less debugging comments in both source and gen-erl/

Notes:
 * in preparation for iproctor's whiz-bang map/list/set support


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665169 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 04:30:15 +00:00
Christopher Piro
094823a46c [thrift] highly concurrent Erlang goodness
Summary:
 * shim to use object-oriented code as gen_servers
 * high(er) performance Erlang-style server and transport
 * sane packaging based on otp-base, i.e. Makefiles and real structure

Test Plan: tutorial server offers the same (subset of) functionality as previous version

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665164 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 00:26:12 +00:00
Christopher Piro
2f5afceeaa [thrift] preliminary Erlang support (initial import)
Summary:
 * missing {list,map,set}s, inheritance is spotty
 * loose source code, plus everything is one process (application / gen_server behavior is forthcoming)
 * codegen is a mess, need t_fp_generator

Test Plan:
 * codegen invoked without -erl generates identical code for test/
 * calculatorHandler plus 'thrift -erl -r tutorial.thrift' more or less works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665146 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 07:17:33 +00:00